comfy-tool 1.0.2 → 1.0.4
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/@types/components/global.d.ts +3 -0
- package/@types/components/index.d.ts +4 -3
- package/@types/components/layout/Column/Column.d.ts +9 -0
- package/@types/components/layout/Column/index.d.ts +14 -0
- package/@types/components/layout/{Expended.vue.d.ts → Expended/Expended.d.ts} +16 -13
- package/@types/components/layout/Expended/index.d.ts +38 -0
- package/@types/components/layout/Row/Row.d.ts +9 -0
- package/@types/components/layout/Row/index.d.ts +14 -0
- package/@types/components/utils/layer/Component.d.ts +9 -9
- package/@types/components/utils/layer/index.d.ts +1 -1
- package/@types/components/utils/layer/layer.d.ts +13 -20
- package/@types/constants/library.d.ts +3 -0
- package/@types/demo/App.vue.d.ts +3 -0
- package/@types/demo/components/AppDialog.vue.d.ts +23 -0
- package/@types/demo/components/Child.vue.d.ts +5 -0
- package/@types/demo/components/Child2.vue.d.ts +5 -0
- package/@types/demo/components/Dialog.vue.d.ts +20 -0
- package/@types/demo/components/TestWorld.vue.d.ts +5 -0
- package/@types/demo/hooks/use-layer.d.ts +5 -0
- package/@types/globals.d.ts +3 -9
- package/@types/index.d.ts +2 -3
- package/@types/shims-vue.d.ts +2 -1
- package/@types/utils/app/installer.d.ts +8 -0
- package/@types/utils/tools.d.ts +11 -0
- package/@types/utils/ui/index.d.ts +3 -0
- package/@types/utils/util/basic.d.ts +2 -6
- package/@types/utils/util/date.d.ts +1 -1
- package/@types/utils/util/index.d.ts +5 -10
- package/@types/utils/util/url.d.ts +21 -2
- package/LICENSE +1 -1
- package/README.md +76 -24
- package/dist/index.css +1 -1
- package/dist/index.min.js +1 -1
- package/es/index.mjs +381 -767
- package/es/utils.mjs +484 -0
- package/lib/index.js +1 -1
- package/lib/utils.js +1 -0
- package/package.json +32 -15
- package/web-types.json +1 -0
- package/@types/components/layout/Column.vue.d.ts +0 -26
- package/@types/components/layout/Row.vue.d.ts +0 -26
package/es/index.mjs
CHANGED
|
@@ -1,421 +1,54 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
if (
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
for (const o of r)
|
|
12
|
-
o.includes("=") && (n || (n = {}), Object.assign(n, J(o.substring(1))));
|
|
13
|
-
} else {
|
|
14
|
-
let r = e.match(/\?([^\?]*$)/);
|
|
15
|
-
if (!r && !e.includes("=")) return null;
|
|
16
|
-
n = J(r ? r[1] : e);
|
|
17
|
-
}
|
|
18
|
-
return n && !t.repeat && Object.entries(n).forEach(([r, o]) => {
|
|
19
|
-
n[r] = ne(o);
|
|
20
|
-
}), n;
|
|
21
|
-
}
|
|
22
|
-
function oe(e, t) {
|
|
23
|
-
return decodeURI(Pe(e, {
|
|
24
|
-
sort: (n, r) => n > r ? 0 : -1
|
|
25
|
-
}));
|
|
26
|
-
}
|
|
27
|
-
function Ie(e, t) {
|
|
28
|
-
return t ? (typeof t != "string" && (t = oe(t)), t ? e + (/^([^#]*\?[^#]*$)|(.*#.*\?.*$)/.test(e) ? "&" : "?") + t : e) : e;
|
|
29
|
-
}
|
|
30
|
-
function Le(e) {
|
|
31
|
-
return /^https?:\/\//.test(e);
|
|
32
|
-
}
|
|
33
|
-
function Me(e) {
|
|
34
|
-
return /^(https?:\/\/|blob:|data:)/.test(e);
|
|
35
|
-
}
|
|
36
|
-
function He(e) {
|
|
37
|
-
let [t, n] = e.split("//"), [r, o] = n.split("/");
|
|
38
|
-
return [t + "//", r, o];
|
|
39
|
-
}
|
|
40
|
-
function J(e) {
|
|
41
|
-
return e ? (e.startsWith("?") && (e = e.slice(1)), e.split("&").reduce((t, n) => {
|
|
42
|
-
if (!n) return t;
|
|
43
|
-
const [r, o] = n.split("="), l = decodeURIComponent(r || ""), i = decodeURIComponent(o || "");
|
|
44
|
-
return t[l] !== void 0 ? (Array.isArray(t[l]) || (t[l] = [t[l]]), t[l].push(i)) : t[l] = i, t;
|
|
45
|
-
}, {})) : {};
|
|
46
|
-
}
|
|
47
|
-
function Pe(e, t = {}) {
|
|
48
|
-
if (!e || typeof e != "object") return "";
|
|
49
|
-
const { sort: n } = t;
|
|
50
|
-
let r = Object.keys(e);
|
|
51
|
-
return typeof n == "function" && r.sort(n), r.map((o) => {
|
|
52
|
-
const l = e[o];
|
|
53
|
-
return Array.isArray(l) ? l.map((i) => `${encodeURIComponent(o)}=${encodeURIComponent(String(i))}`).join("&") : `${encodeURIComponent(o)}=${encodeURIComponent(String(l))}`;
|
|
54
|
-
}).join("&");
|
|
55
|
-
}
|
|
56
|
-
function Ne() {
|
|
57
|
-
}
|
|
58
|
-
function Re(e) {
|
|
59
|
-
}
|
|
60
|
-
function Ue(e) {
|
|
61
|
-
Y(e);
|
|
62
|
-
}
|
|
63
|
-
const j = Object.assign;
|
|
64
|
-
function re(e) {
|
|
65
|
-
return Object.keys(e);
|
|
66
|
-
}
|
|
67
|
-
function je(e) {
|
|
68
|
-
return Object.values(e);
|
|
69
|
-
}
|
|
70
|
-
function le(e) {
|
|
71
|
-
return Object.entries(e);
|
|
72
|
-
}
|
|
73
|
-
function ie(e, t, n = !1) {
|
|
74
|
-
return t.reduce((r, o) => ((!n || e[o] !== void 0) && (r[o] = e[o]), r), {});
|
|
75
|
-
}
|
|
76
|
-
function S(e, t, n = !1) {
|
|
77
|
-
return Object.keys(e).filter((o) => !t.includes(o)).reduce((o, l) => ((!n || e[l] !== void 0) && (o[l] = e[l]), o), {});
|
|
78
|
-
}
|
|
79
|
-
function T(e) {
|
|
80
|
-
return Object.prototype.toString.call(e).match(/\[object (.+)\]/)[1];
|
|
81
|
-
}
|
|
82
|
-
function We(e, t) {
|
|
83
|
-
let n = e;
|
|
84
|
-
if (t) {
|
|
85
|
-
const r = typeof t == "string" ? t.split(".") : t;
|
|
86
|
-
for (const o of r)
|
|
87
|
-
if (n && typeof n == "object" && o in n)
|
|
88
|
-
n = n[o];
|
|
89
|
-
else
|
|
90
|
-
return;
|
|
91
|
-
}
|
|
92
|
-
return n;
|
|
93
|
-
}
|
|
94
|
-
function k(e, t, { arrayMergeStrategy: n, deepMerge: r } = {}) {
|
|
95
|
-
if (!t || Object.keys(t).length === 0)
|
|
96
|
-
return D(e);
|
|
97
|
-
if (!e || Object.keys(e).length === 0)
|
|
98
|
-
return D(t);
|
|
99
|
-
let o = D(e);
|
|
100
|
-
for (const l of Object.keys(t)) {
|
|
101
|
-
let i = e[l], a = t[l];
|
|
102
|
-
if (r && T(i) == "Object" && T(a) == "Object")
|
|
103
|
-
o[l] = k(i, a);
|
|
104
|
-
else if (r && Array.isArray(i) && Array.isArray(a))
|
|
105
|
-
switch (n) {
|
|
106
|
-
case "concat":
|
|
107
|
-
o[l] = [...i, ...a];
|
|
108
|
-
break;
|
|
109
|
-
case "merge":
|
|
110
|
-
o[l] = i.map(
|
|
111
|
-
(f, s) => s < a.length ? k({ value: f }, { value: a[s] }).value : f
|
|
112
|
-
);
|
|
113
|
-
break;
|
|
114
|
-
case "replace":
|
|
115
|
-
default:
|
|
116
|
-
o[l] = [...a];
|
|
117
|
-
break;
|
|
118
|
-
}
|
|
119
|
-
else
|
|
120
|
-
o[l] = a;
|
|
121
|
-
}
|
|
122
|
-
return o;
|
|
123
|
-
}
|
|
124
|
-
const se = (e) => JSON.parse(JSON.stringify(e)), D = function(e) {
|
|
125
|
-
if (e == null || typeof e != "object")
|
|
126
|
-
return e;
|
|
127
|
-
if (Array.isArray(e))
|
|
128
|
-
return e.length ? e.map((n) => D(n)) : [];
|
|
129
|
-
if (T(e) === "Object") {
|
|
130
|
-
var t = {};
|
|
131
|
-
return Object.keys(e).forEach((n) => {
|
|
132
|
-
t[n] = D(e[n]);
|
|
133
|
-
}), t;
|
|
134
|
-
}
|
|
1
|
+
var ie = Object.defineProperty, ae = Object.defineProperties;
|
|
2
|
+
var le = Object.getOwnPropertyDescriptors;
|
|
3
|
+
var R = Object.getOwnPropertySymbols;
|
|
4
|
+
var ue = Object.prototype.hasOwnProperty, ce = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var W = (e, t, n) => t in e ? ie(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, f = (e, t) => {
|
|
6
|
+
for (var n in t || (t = {}))
|
|
7
|
+
ue.call(t, n) && W(e, n, t[n]);
|
|
8
|
+
if (R)
|
|
9
|
+
for (var n of R(t))
|
|
10
|
+
ce.call(t, n) && W(e, n, t[n]);
|
|
135
11
|
return e;
|
|
136
|
-
};
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
function Fe(e) {
|
|
141
|
-
return e.replace(/([A-Z])/g, "-$1").toLowerCase().replace(/^-/, "");
|
|
142
|
-
}
|
|
143
|
-
function Ve(e, t = 2) {
|
|
144
|
-
for (var n = e + ""; n.length < t; )
|
|
145
|
-
n = "0" + n;
|
|
146
|
-
return n;
|
|
147
|
-
}
|
|
148
|
-
function Ye(e, t = 2) {
|
|
149
|
-
if (e.length === 0 || !t) return [];
|
|
150
|
-
const n = [];
|
|
151
|
-
let r = [];
|
|
152
|
-
for (let o = 0; o < e.length; o++)
|
|
153
|
-
r.push(e[o]), r.length === t && (n.push(r), r = []);
|
|
154
|
-
return r.length > 0 && n.push(r), n;
|
|
155
|
-
}
|
|
156
|
-
function Be(e) {
|
|
157
|
-
let t = [];
|
|
158
|
-
for (const n in e)
|
|
159
|
-
Object.prototype.hasOwnProperty.call(e, n) && t.push({
|
|
160
|
-
text: e[n],
|
|
161
|
-
label: e[n],
|
|
162
|
-
value: n
|
|
163
|
-
});
|
|
164
|
-
return t;
|
|
165
|
-
}
|
|
166
|
-
function Ke(e) {
|
|
167
|
-
let t = {};
|
|
168
|
-
return e.forEach((n) => {
|
|
169
|
-
t[n.value] = n.text;
|
|
170
|
-
}), t;
|
|
171
|
-
}
|
|
172
|
-
function Ge(e) {
|
|
173
|
-
let t = new FormData();
|
|
174
|
-
return Object.entries(e).forEach(([n, r]) => {
|
|
175
|
-
t.append(n, r);
|
|
176
|
-
}), t;
|
|
177
|
-
}
|
|
178
|
-
function ue(e, t = {}) {
|
|
179
|
-
let { labelKey: n, valueKey: r, childrenKey: o, keepEmptyChildren: l } = t;
|
|
180
|
-
return n = n || "label", r = r || "value", o = o || "children", l = l !== !1, e.map((i) => {
|
|
181
|
-
const a = {
|
|
182
|
-
...i,
|
|
183
|
-
label: i[n] || i.label || "",
|
|
184
|
-
// 默认值为空字符串
|
|
185
|
-
value: i[r] || i.value || "",
|
|
186
|
-
// 默认值为空字符串
|
|
187
|
-
text: i[r] || i.value || ""
|
|
188
|
-
// 默认值为空字符串
|
|
189
|
-
};
|
|
190
|
-
return i[o] && Array.isArray(i[o]) && (l || i[o].length) && (a.children = ue(i[o], t)), a;
|
|
191
|
-
});
|
|
192
|
-
}
|
|
193
|
-
function Je(e, t) {
|
|
194
|
-
if (!t) return e;
|
|
195
|
-
const n = e.indexOf(t);
|
|
196
|
-
return n === -1 ? e : e.filter((r, o) => o !== n);
|
|
197
|
-
}
|
|
198
|
-
function ze(e, t) {
|
|
199
|
-
if (!t) return;
|
|
200
|
-
let n = e.indexOf(t);
|
|
201
|
-
n >= 0 && e.splice(n, 1);
|
|
202
|
-
}
|
|
203
|
-
function Xe(e) {
|
|
204
|
-
return e.filter((t) => t != null);
|
|
205
|
-
}
|
|
206
|
-
function Ze(e) {
|
|
207
|
-
return e.filter((t) => !!t);
|
|
208
|
-
}
|
|
209
|
-
function Qe(e) {
|
|
210
|
-
e.splice(0, e.length);
|
|
211
|
-
}
|
|
212
|
-
function qe(e, t) {
|
|
213
|
-
if (!e || !t || !e.length || !t.length) return !1;
|
|
214
|
-
var n = t.some((r) => e.includes(r));
|
|
215
|
-
return n;
|
|
216
|
-
}
|
|
217
|
-
function et(e, t = 2) {
|
|
218
|
-
return n(e, t);
|
|
219
|
-
function n(r, o) {
|
|
220
|
-
return o--, r.map((l) => (o <= 0 ? delete l.children : l.children = l.children ? n(l.children, o) : [], l));
|
|
221
|
-
}
|
|
222
|
-
}
|
|
223
|
-
function tt(e, t = 1, n = !0) {
|
|
224
|
-
let r = [...e];
|
|
225
|
-
return t >= r.length && n ? r : fe(r).slice(0, t);
|
|
226
|
-
}
|
|
227
|
-
function fe(e) {
|
|
228
|
-
const t = [...e];
|
|
229
|
-
for (let n = t.length; --n; ) {
|
|
230
|
-
const r = Math.floor(Math.random() * (n + 1));
|
|
231
|
-
[t[n], t[r]] = [t[r], t[n]];
|
|
232
|
-
}
|
|
233
|
-
return t;
|
|
234
|
-
}
|
|
235
|
-
function nt(e, t) {
|
|
236
|
-
const [n, r, o] = t;
|
|
237
|
-
let l = {};
|
|
238
|
-
i(e, []);
|
|
239
|
-
function i(a, f) {
|
|
240
|
-
a.forEach((s, h) => {
|
|
241
|
-
let c = se(f);
|
|
242
|
-
if (c.push(h), Array.isArray(s))
|
|
243
|
-
i(s, c);
|
|
244
|
-
else {
|
|
245
|
-
let d = s[n] || r && s[r] || o && s[o];
|
|
246
|
-
d && (l[d] = c);
|
|
247
|
-
}
|
|
248
|
-
});
|
|
249
|
-
}
|
|
250
|
-
return l;
|
|
251
|
-
}
|
|
252
|
-
function ce(e) {
|
|
253
|
-
return typeof e == "number" || /^[+-]?\d*(\.\d+)?$/.test(e);
|
|
254
|
-
}
|
|
255
|
-
function v(e, t) {
|
|
256
|
-
return typeof e == "number" ? e + t : e + (ce(e) ? t : "");
|
|
257
|
-
}
|
|
258
|
-
function ot(e, t, n = 2) {
|
|
259
|
-
return Math.floor(e / t * 100 * 10 ** n) / 10 ** n;
|
|
260
|
-
}
|
|
261
|
-
function pe(e, t) {
|
|
262
|
-
return de(L(e).getDay(), t);
|
|
263
|
-
}
|
|
264
|
-
function de(e, t = 0) {
|
|
265
|
-
return typeof e == "string" && (e = parseInt(e)), [
|
|
266
|
-
["星期天", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六", "星期天"],
|
|
267
|
-
["周日", "周一", "周二", "周三", "周四", "周五", "周六", "周日"]
|
|
268
|
-
][t][e];
|
|
269
|
-
}
|
|
270
|
-
function p(e, t = "YYYY-MM-DD") {
|
|
271
|
-
(typeof e == "number" || typeof e == "string") && (e = L(e));
|
|
272
|
-
let n = {
|
|
273
|
-
"Y+": e.getFullYear(),
|
|
274
|
-
// 年
|
|
275
|
-
"M+": e.getMonth() + 1,
|
|
276
|
-
// 月
|
|
277
|
-
"D+": e.getDate(),
|
|
278
|
-
// 日
|
|
279
|
-
"H+": e.getHours(),
|
|
280
|
-
// 时
|
|
281
|
-
"m+": e.getMinutes(),
|
|
282
|
-
// 分
|
|
283
|
-
"S+": e.getSeconds()
|
|
284
|
-
// 秒
|
|
285
|
-
};
|
|
286
|
-
return Object.keys(n).forEach((r) => {
|
|
287
|
-
let o = r, l = new RegExp(o), i = null;
|
|
288
|
-
(i = t.match(l)) && (i[0].length > 1 && n[o] < 10 ? t = t.replace(l, "0" + n[o]) : t = t.replace(l, n[o].toString()));
|
|
289
|
-
}), t;
|
|
290
|
-
}
|
|
291
|
-
function L(e) {
|
|
292
|
-
return e ? (typeof e == "string" && (e = e.replace(/\-/g, "/")), e = new Date(e), e.getTime() ? e : /* @__PURE__ */ new Date()) : /* @__PURE__ */ new Date();
|
|
293
|
-
}
|
|
294
|
-
function rt(e) {
|
|
295
|
-
let t = /* @__PURE__ */ new Date(), n = t.getDay(), r = t.getDate(), o = /* @__PURE__ */ new Date(), l = /* @__PURE__ */ new Date(), i = /* @__PURE__ */ new Date(), a = /* @__PURE__ */ new Date(), f = /* @__PURE__ */ new Date(), s, h, c = t.getFullYear(), d = t.getMonth();
|
|
296
|
-
return o = new Date(c, d, r - (n || 7) + 1), l = new Date(o), l.setDate(o.getDate() - 7), i = new Date(l), i.setDate(l.getDate() + 6), s = new Date(c, d, 1), h = new Date(c, d + 1, 0), a = new Date(c, d - 1, 1), f = new Date(c, d, 0), e && (t = p(t), o = p(o), l = p(l), i = p(i), s = p(s), h = p(h), a = p(a), f = p(f)), {
|
|
297
|
-
today: t,
|
|
298
|
-
thisWeekFirst: o,
|
|
299
|
-
lastWeekFirst: l,
|
|
300
|
-
lastWeekEnd: i,
|
|
301
|
-
thisMonthFirst: s,
|
|
302
|
-
thisMonthEnd: h,
|
|
303
|
-
lastMonthFirst: a,
|
|
304
|
-
lastMonthEnd: f
|
|
305
|
-
};
|
|
306
|
-
}
|
|
307
|
-
function lt(e, t, n) {
|
|
308
|
-
typeof e == "string" && (e = e.replace(/\-/g, "/"));
|
|
309
|
-
let r = 60 * 1e3, o = 60 * r, l = 24 * o, i = new Date(e), a = (/* @__PURE__ */ new Date()).getTime() - i.getTime(), f = (/* @__PURE__ */ new Date()).toString().slice(0, 15) === i.toString().slice(0, 15), s = pe(i), h = t ? "今天" : "", c = Math.floor(a / l), d = Math.floor(a / o), O = Math.floor(a / r);
|
|
310
|
-
return n = n || 7, c > n ? p(i, "MM月DD日 HH:mm") : c > 2 ? s + " " + p(i, "HH:mm") : c > 1 ? "前天 " + p(i, "HH:mm") : c > 0 ? "昨天 " + p(i, "HH:mm") : d >= 11 ? (f ? h : "昨天 ") + p(i, "HH:mm") : d >= 1 ? f ? d + "小时前" : "昨天 " + p(i, "HH:mm") : O >= 1 ? O + "分钟前" : "刚刚";
|
|
311
|
-
}
|
|
312
|
-
function it(e, t) {
|
|
313
|
-
let n = L(e);
|
|
314
|
-
return p(n.setDate(n.getDate() + t));
|
|
315
|
-
}
|
|
316
|
-
function st(e, t = 1e3) {
|
|
317
|
-
let n = null;
|
|
318
|
-
return function() {
|
|
319
|
-
let r = this, o = arguments;
|
|
320
|
-
n && clearTimeout(n), n = setTimeout(function() {
|
|
321
|
-
e.apply(r, o);
|
|
322
|
-
}, t);
|
|
323
|
-
};
|
|
324
|
-
}
|
|
325
|
-
function at(e, t = 1e3) {
|
|
326
|
-
let n;
|
|
327
|
-
return function() {
|
|
328
|
-
(!n || Date.now() - n > t) && (e.apply(this, arguments), n = Date.now());
|
|
329
|
-
};
|
|
330
|
-
}
|
|
331
|
-
function ut(e, t = 1e3) {
|
|
332
|
-
let n;
|
|
333
|
-
return async function(...r) {
|
|
334
|
-
if (!n || Date.now() - n > t)
|
|
335
|
-
return n = Date.now(), await e.apply(this, r);
|
|
336
|
-
};
|
|
337
|
-
}
|
|
338
|
-
function he(e, t = []) {
|
|
339
|
-
Array.isArray(e) ? e.forEach((n) => {
|
|
340
|
-
n && typeof n == "function" && n.apply(void 0, t);
|
|
341
|
-
}) : e && typeof e == "function" && e.apply(void 0, t);
|
|
342
|
-
}
|
|
343
|
-
const ft = {
|
|
344
|
-
cacheResult(e) {
|
|
345
|
-
let t = null, n = null;
|
|
346
|
-
return function(...r) {
|
|
347
|
-
return t && r && t === JSON.stringify(r) ? n : (t = JSON.stringify(r), n = e.apply(this, r));
|
|
348
|
-
};
|
|
349
|
-
}
|
|
350
|
-
};
|
|
351
|
-
function me(e) {
|
|
352
|
-
return e ? /^\[.*\]$/.test(e) : !1;
|
|
353
|
-
}
|
|
354
|
-
function ye(e) {
|
|
355
|
-
return e ? /^\{.*\}$/.test(e) : !1;
|
|
356
|
-
}
|
|
357
|
-
function ge(e) {
|
|
358
|
-
return /^\/.+\/[img]{0,3}$/.test(e);
|
|
359
|
-
}
|
|
360
|
-
function ct(e) {
|
|
361
|
-
return typeof e == "string" ? me(e) ? JSON.parse(e || "[]") : [] : e || [];
|
|
362
|
-
}
|
|
363
|
-
function pt(e) {
|
|
364
|
-
return typeof e == "string" ? ye(e) ? JSON.parse(e || "{}") : {} : e || {};
|
|
365
|
-
}
|
|
366
|
-
function dt(e) {
|
|
367
|
-
if (typeof e == "string" && ge(e)) {
|
|
368
|
-
let t = e.match(/^\/(.+)\/([img]{0,3})$/);
|
|
369
|
-
return new RegExp(t[1], t[2]);
|
|
370
|
-
} else
|
|
371
|
-
return new RegExp("");
|
|
372
|
-
}
|
|
373
|
-
function ht(e, t = "i") {
|
|
374
|
-
return e = `^${e.replace(/\b|\B/g, ".*")}$`, new RegExp(e, t);
|
|
375
|
-
}
|
|
376
|
-
function mt(e) {
|
|
377
|
-
const t = e.split(";base64,"), n = t[0].split(":")[1], r = window.atob(t[1]), o = r.length, l = new Uint8Array(o);
|
|
378
|
-
for (let i = 0; i < o; i += 1)
|
|
379
|
-
l[i] = r.charCodeAt(i);
|
|
380
|
-
return new Blob([l], { type: n });
|
|
381
|
-
}
|
|
382
|
-
function yt(e) {
|
|
12
|
+
}, _ = (e, t) => ae(e, le(t));
|
|
13
|
+
import { camelize as K, pick as q, keysOf as z, merge as G, pickEx as E, Fn as fe, addUnit as h, arrayToGroup as se, base64ToBlob as de, cloneJSON as me, dateGo as he, dealTime as pe, debounce as ye, decodeURIComponentSafe as ve, decodeURISafe as ge, deepClone as be, deleteItemForArr as Ce, emptyArray as xe, entriesOf as X, extend as P, formatDate as we, formatSelectedData as Se, formatToSelectData as Ee, getArrayDataIndex as Te, getDateConfig as Le, getFuzzyMatchRegExp as Ae, getPercentage as De, getProperty as Oe, getRandomElements as _e, getUniqueParam as Ie, getWeek as Pe, getWeekByNo as Ne, hasSameItem as ke, isArrayString as $e, isFullUrl as He, isNumber as Me, isObjectString as Re, isRegExpString as We, isWebUrl as Ve, kebabCase as Ue, methodApply as J, padZero as je, parseArray as Fe, parseDate as Ye, parseObject as Be, parseRegExp as Ke, parseUrl as qe, queryParse as ze, queryStringify as Ge, removeEmptyForArr as Xe, removeFalseForArr as Je, removeItemForArr as Ze, selectDataToObj as Qe, shuffleArray as et, throttle as tt, throttleAsync as nt, toFormData as ot, toSelectData as rt, typeOf as it, urlAddParams as at, valuesOf as lt } from "./utils.mjs";
|
|
14
|
+
import { h as N, reactive as ut, unref as ct, defineComponent as L, createVNode as y, mergeProps as T, render as ft, shallowRef as V, ref as st, shallowReactive as dt, watch as mt, provide as ht, nextTick as pt } from "vue";
|
|
15
|
+
function $(e) {
|
|
383
16
|
return e.install = (t) => {
|
|
384
17
|
let { name: n } = e;
|
|
385
|
-
t.component(n, e), t.component(
|
|
18
|
+
t.component(n, e), t.component(K("-" + n), e);
|
|
386
19
|
}, e;
|
|
387
20
|
}
|
|
388
|
-
function
|
|
389
|
-
return e ? typeof e == "function" ? e() || t :
|
|
21
|
+
function yt(e, t = N("div"), n) {
|
|
22
|
+
return e ? typeof e == "function" ? e() || t : N(e, n && ut(n)) : t;
|
|
390
23
|
}
|
|
391
24
|
function vt(e) {
|
|
392
25
|
return !!(e && e.$el && e.$props && e.$options && e.$emit);
|
|
393
26
|
}
|
|
394
|
-
function
|
|
395
|
-
let t =
|
|
27
|
+
function gt(e) {
|
|
28
|
+
let t = Z(e);
|
|
396
29
|
t && (t.scrollTop = 0);
|
|
397
30
|
}
|
|
398
|
-
function
|
|
31
|
+
function Z(e) {
|
|
399
32
|
return document.getElementById(e);
|
|
400
33
|
}
|
|
401
|
-
function
|
|
402
|
-
let t =
|
|
34
|
+
function Q(e) {
|
|
35
|
+
let t = ct(e);
|
|
403
36
|
return vt(t) ? t.$el : t instanceof HTMLElement ? t : null;
|
|
404
37
|
}
|
|
405
38
|
function bt(e, t) {
|
|
406
39
|
return getComputedStyle(e).getPropertyValue(t);
|
|
407
40
|
}
|
|
408
|
-
function
|
|
41
|
+
function Ct(e, t, n = !0) {
|
|
409
42
|
e.classList.remove(...t.split(" ")), n && e.classList.add(t);
|
|
410
43
|
}
|
|
411
|
-
const
|
|
44
|
+
const m = {
|
|
412
45
|
rootId: "app",
|
|
413
46
|
app: void 0
|
|
414
47
|
};
|
|
415
|
-
function
|
|
416
|
-
e.rootId && (
|
|
48
|
+
function xt(e = {}) {
|
|
49
|
+
e.rootId && (m.rootId = e.rootId), e.app && (m.app = e.app);
|
|
417
50
|
}
|
|
418
|
-
const
|
|
51
|
+
const b = {
|
|
419
52
|
toast(e) {
|
|
420
53
|
},
|
|
421
54
|
alert(e) {
|
|
@@ -426,154 +59,317 @@ const $ = {
|
|
|
426
59
|
hideLoading() {
|
|
427
60
|
}
|
|
428
61
|
};
|
|
429
|
-
function
|
|
430
|
-
let t =
|
|
431
|
-
|
|
62
|
+
function wt(e) {
|
|
63
|
+
let t = z(m);
|
|
64
|
+
xt(q(e, t)), G(b, E(e, t), {
|
|
432
65
|
deepMerge: !0,
|
|
433
66
|
arrayMergeStrategy: "concat"
|
|
434
67
|
});
|
|
435
68
|
}
|
|
436
|
-
function
|
|
437
|
-
|
|
69
|
+
function St() {
|
|
70
|
+
}
|
|
71
|
+
function Et(e) {
|
|
72
|
+
}
|
|
73
|
+
function Tt(e) {
|
|
74
|
+
H(e);
|
|
75
|
+
}
|
|
76
|
+
function H(e) {
|
|
77
|
+
b.toast(e);
|
|
438
78
|
}
|
|
439
|
-
function
|
|
440
|
-
|
|
79
|
+
function Lt(e) {
|
|
80
|
+
b.alert(e);
|
|
441
81
|
}
|
|
442
|
-
const
|
|
82
|
+
const S = {
|
|
443
83
|
show(e = "") {
|
|
444
|
-
|
|
84
|
+
b.showLoading(e);
|
|
445
85
|
},
|
|
446
86
|
hide() {
|
|
447
|
-
|
|
87
|
+
b.hideLoading();
|
|
448
88
|
}
|
|
449
89
|
};
|
|
450
|
-
let
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
90
|
+
let k;
|
|
91
|
+
try {
|
|
92
|
+
k = document.createElement("a");
|
|
93
|
+
} catch (e) {
|
|
454
94
|
}
|
|
455
|
-
|
|
95
|
+
function At(e, t = "未获取到联系电话") {
|
|
96
|
+
if (!e) return H(t);
|
|
97
|
+
e = typeof e == "number" ? e.toString() : e, k.href = /^tel:.*/.test(e) ? e : "tel:" + e, k.click();
|
|
98
|
+
}
|
|
99
|
+
const Dt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
456
100
|
__proto__: null,
|
|
457
|
-
$:
|
|
458
|
-
$alert:
|
|
459
|
-
$loading:
|
|
460
|
-
$refDOM:
|
|
461
|
-
$toast:
|
|
462
|
-
Fn:
|
|
463
|
-
addUnit:
|
|
464
|
-
arrayToGroup:
|
|
465
|
-
base64ToBlob:
|
|
466
|
-
camelize:
|
|
467
|
-
cloneJSON:
|
|
468
|
-
dateGo:
|
|
469
|
-
dealTime:
|
|
470
|
-
debounce:
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
101
|
+
$: Z,
|
|
102
|
+
$alert: Lt,
|
|
103
|
+
$loading: S,
|
|
104
|
+
$refDOM: Q,
|
|
105
|
+
$toast: H,
|
|
106
|
+
Fn: fe,
|
|
107
|
+
addUnit: h,
|
|
108
|
+
arrayToGroup: se,
|
|
109
|
+
base64ToBlob: de,
|
|
110
|
+
camelize: K,
|
|
111
|
+
cloneJSON: me,
|
|
112
|
+
dateGo: he,
|
|
113
|
+
dealTime: pe,
|
|
114
|
+
debounce: ye,
|
|
115
|
+
decodeURIComponentSafe: ve,
|
|
116
|
+
decodeURISafe: ge,
|
|
117
|
+
deepClone: be,
|
|
118
|
+
deleteItemForArr: Ce,
|
|
119
|
+
emptyArray: xe,
|
|
120
|
+
entriesOf: X,
|
|
121
|
+
errorCatch: Tt,
|
|
122
|
+
extend: P,
|
|
123
|
+
formatDate: we,
|
|
124
|
+
formatSelectedData: Se,
|
|
125
|
+
formatToSelectData: Ee,
|
|
126
|
+
getArrayDataIndex: Te,
|
|
127
|
+
getDateConfig: Le,
|
|
482
128
|
getElementPropertyValue: bt,
|
|
483
|
-
getFuzzyMatchRegExp:
|
|
484
|
-
getPercentage:
|
|
485
|
-
getProperty:
|
|
486
|
-
getRandomElements:
|
|
487
|
-
getUniqueParam:
|
|
488
|
-
getWeek:
|
|
489
|
-
getWeekByNo:
|
|
490
|
-
hasSameItem:
|
|
491
|
-
isArrayString:
|
|
492
|
-
isFullUrl:
|
|
493
|
-
isNumber:
|
|
494
|
-
isObjectString:
|
|
495
|
-
isRegExpString:
|
|
496
|
-
isWebUrl:
|
|
497
|
-
kebabCase:
|
|
498
|
-
keysOf:
|
|
499
|
-
merge:
|
|
500
|
-
methodApply:
|
|
501
|
-
noop:
|
|
502
|
-
noopCatch:
|
|
503
|
-
padZero:
|
|
504
|
-
parseArray:
|
|
505
|
-
parseDate:
|
|
506
|
-
parseObject:
|
|
507
|
-
parseRegExp:
|
|
508
|
-
parseUrl:
|
|
509
|
-
pick:
|
|
510
|
-
pickEx:
|
|
511
|
-
queryParse:
|
|
512
|
-
queryStringify:
|
|
129
|
+
getFuzzyMatchRegExp: Ae,
|
|
130
|
+
getPercentage: De,
|
|
131
|
+
getProperty: Oe,
|
|
132
|
+
getRandomElements: _e,
|
|
133
|
+
getUniqueParam: Ie,
|
|
134
|
+
getWeek: Pe,
|
|
135
|
+
getWeekByNo: Ne,
|
|
136
|
+
hasSameItem: ke,
|
|
137
|
+
isArrayString: $e,
|
|
138
|
+
isFullUrl: He,
|
|
139
|
+
isNumber: Me,
|
|
140
|
+
isObjectString: Re,
|
|
141
|
+
isRegExpString: We,
|
|
142
|
+
isWebUrl: Ve,
|
|
143
|
+
kebabCase: Ue,
|
|
144
|
+
keysOf: z,
|
|
145
|
+
merge: G,
|
|
146
|
+
methodApply: J,
|
|
147
|
+
noop: St,
|
|
148
|
+
noopCatch: Et,
|
|
149
|
+
padZero: je,
|
|
150
|
+
parseArray: Fe,
|
|
151
|
+
parseDate: Ye,
|
|
152
|
+
parseObject: Be,
|
|
153
|
+
parseRegExp: Ke,
|
|
154
|
+
parseUrl: qe,
|
|
155
|
+
pick: q,
|
|
156
|
+
pickEx: E,
|
|
157
|
+
queryParse: ze,
|
|
158
|
+
queryStringify: Ge,
|
|
513
159
|
removeEmptyForArr: Xe,
|
|
514
|
-
removeFalseForArr:
|
|
515
|
-
removeItemForArr:
|
|
516
|
-
scrollToTop:
|
|
517
|
-
selectDataToObj:
|
|
518
|
-
shuffleArray:
|
|
519
|
-
telephoneCall:
|
|
520
|
-
throttle:
|
|
521
|
-
throttleAsync:
|
|
522
|
-
toFormData:
|
|
523
|
-
toSelectData:
|
|
524
|
-
toggleClass:
|
|
525
|
-
typeOf:
|
|
526
|
-
urlAddParams:
|
|
527
|
-
valuesOf:
|
|
528
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
529
|
-
function
|
|
530
|
-
return
|
|
531
|
-
|
|
532
|
-
}) : e.production ? Promise.resolve("Ignored in development environment!") : (
|
|
160
|
+
removeFalseForArr: Je,
|
|
161
|
+
removeItemForArr: Ze,
|
|
162
|
+
scrollToTop: gt,
|
|
163
|
+
selectDataToObj: Qe,
|
|
164
|
+
shuffleArray: et,
|
|
165
|
+
telephoneCall: At,
|
|
166
|
+
throttle: tt,
|
|
167
|
+
throttleAsync: nt,
|
|
168
|
+
toFormData: ot,
|
|
169
|
+
toSelectData: rt,
|
|
170
|
+
toggleClass: Ct,
|
|
171
|
+
typeOf: it,
|
|
172
|
+
urlAddParams: at,
|
|
173
|
+
valuesOf: lt
|
|
174
|
+
}, Symbol.toStringTag, { value: "Module" })), s = {};
|
|
175
|
+
function U(e) {
|
|
176
|
+
return s[e.url] && s[e.url].status === 1 ? Promise.resolve("The resource is already loaded!") : s[e.url] && s[e.url].status === 2 ? new Promise((t, n) => {
|
|
177
|
+
s[e.url].waiters.push(t);
|
|
178
|
+
}) : e.production ? Promise.resolve("Ignored in development environment!") : (S.show("资源加载中"), s[e.url] ? s[e.url].status = 2 : s[e.url] = {
|
|
533
179
|
status: 2,
|
|
534
180
|
waiters: []
|
|
535
181
|
}, new Promise((t, n) => {
|
|
536
182
|
const r = () => {
|
|
537
|
-
|
|
183
|
+
c(), d();
|
|
538
184
|
}, o = () => {
|
|
539
|
-
|
|
185
|
+
u(), d();
|
|
540
186
|
};
|
|
541
|
-
let
|
|
542
|
-
e.type === "js" ? (
|
|
543
|
-
function
|
|
544
|
-
|
|
187
|
+
let i = null;
|
|
188
|
+
e.type === "js" ? (i = document.createElement("script"), i.src = e.url, i.onload = r, i.onerror = o) : e.type === "css" && (i = document.createElement("link"), i.rel = "stylesheet", i.href = e.url, i.onload = r, i.onerror = o), i && document.head.appendChild(i);
|
|
189
|
+
function c() {
|
|
190
|
+
s[e.url].status = 1, S.hide(), t(e.url), J(s[e.url].waiters, [e.url]);
|
|
545
191
|
}
|
|
546
|
-
function
|
|
547
|
-
|
|
192
|
+
function u() {
|
|
193
|
+
s[e.url].status = 0, S.hide(), n(new Error("Failed to load " + e.url));
|
|
548
194
|
}
|
|
549
|
-
function
|
|
550
|
-
|
|
195
|
+
function d() {
|
|
196
|
+
i && (i.onload = null, i.onerror = null);
|
|
551
197
|
}
|
|
552
198
|
}));
|
|
553
199
|
}
|
|
554
200
|
function Jt(e) {
|
|
555
|
-
return Array.isArray(e) ? Promise.all(e.map((t) =>
|
|
201
|
+
return Array.isArray(e) ? Promise.all(e.map((t) => U(t))) : U(e);
|
|
202
|
+
}
|
|
203
|
+
const j = Symbol("INSTALLED_KEY"), F = Symbol("COMPONENT_INSTALLED_KEY"), Y = Symbol("DIRECTIVES_INSTALLED_KEY"), Ot = {
|
|
204
|
+
mounted(e, t, n, r) {
|
|
205
|
+
typeof t.value == "function" && t.value(e);
|
|
206
|
+
},
|
|
207
|
+
unmounted(e, t, n, r) {
|
|
208
|
+
typeof t.value == "function" && t.value(null);
|
|
209
|
+
}
|
|
210
|
+
}, _t = {
|
|
211
|
+
mounted(e, t, n, r) {
|
|
212
|
+
e.focus();
|
|
213
|
+
},
|
|
214
|
+
updated(e, t, n, r) {
|
|
215
|
+
}
|
|
216
|
+
}, It = function(t, n, r, o) {
|
|
217
|
+
t.style.height = t.parentElement.offsetHeight + "px", t.style.minHeight = "100%";
|
|
218
|
+
};
|
|
219
|
+
function Pt(e, t, n, r) {
|
|
220
|
+
if (t.value.__used) return;
|
|
221
|
+
let o = f({}, t.value);
|
|
222
|
+
if (o.behavior = o.behavior || "smooth", typeof o.right == "number" && (o.left = e.scrollWidth - o.right), typeof o.bottom == "number" && (o.top = e.scrollHeight - o.bottom), o.target) {
|
|
223
|
+
let i = Q(o.target);
|
|
224
|
+
if (i) {
|
|
225
|
+
let { offsetTop: c, offsetLeft: u } = i.offsetParent || { offsetTop: 0, offsetLeft: 0 };
|
|
226
|
+
o.left = i.offsetLeft - e.offsetLeft + u, o.top = i.offsetTop - e.offsetTop + c;
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
o.left && typeof o.offsetX == "number" && (o.left += o.offsetX), o.top && typeof o.offsetY == "number" && (o.top += o.offsetY), Object.defineProperty(t.value, "__used", {
|
|
230
|
+
value: !0,
|
|
231
|
+
enumerable: !1,
|
|
232
|
+
writable: !0
|
|
233
|
+
}), o.beforeScroll ? o.beforeScroll(() => {
|
|
234
|
+
e.scrollTo(o);
|
|
235
|
+
}, o, e) : e.scrollTo(o);
|
|
236
|
+
}
|
|
237
|
+
const I = {
|
|
238
|
+
dom: Ot,
|
|
239
|
+
focus: _t,
|
|
240
|
+
maxHeight: It,
|
|
241
|
+
scroll: Pt
|
|
242
|
+
};
|
|
243
|
+
function Nt(e) {
|
|
244
|
+
if (!e[Y]) {
|
|
245
|
+
e[Y] = !0;
|
|
246
|
+
for (const t of Object.keys(I))
|
|
247
|
+
e.directive(I[t].name || t, I[t]);
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
const kt = {
|
|
251
|
+
reverse: Boolean
|
|
252
|
+
}, $t = /* @__PURE__ */ L({
|
|
253
|
+
name: "column",
|
|
254
|
+
inheritAttrs: !1,
|
|
255
|
+
props: kt,
|
|
256
|
+
setup(e, {
|
|
257
|
+
attrs: t,
|
|
258
|
+
slots: n
|
|
259
|
+
}) {
|
|
260
|
+
var r, o, i, c, u;
|
|
261
|
+
return y("div", T({
|
|
262
|
+
class: {
|
|
263
|
+
"comfy-tool--column": !0,
|
|
264
|
+
reverse: e.reverse
|
|
265
|
+
}
|
|
266
|
+
}, t), [((r = n.before) == null ? void 0 : r.call(n)) || "", ((o = n["before-content"]) == null ? void 0 : o.call(n)) || "", y("div", {
|
|
267
|
+
class: "main-content"
|
|
268
|
+
}, [((i = n.default) == null ? void 0 : i.call(n)) || ""]), ((c = n["after-content"]) == null ? void 0 : c.call(n)) || "", ((u = n.after) == null ? void 0 : u.call(n)) || ""]);
|
|
269
|
+
}
|
|
270
|
+
}), Ht = $($t), Mt = {
|
|
271
|
+
reverse: Boolean
|
|
272
|
+
}, Rt = /* @__PURE__ */ L({
|
|
273
|
+
name: "row",
|
|
274
|
+
inheritAttrs: !1,
|
|
275
|
+
props: Mt,
|
|
276
|
+
setup(e, {
|
|
277
|
+
attrs: t,
|
|
278
|
+
slots: n
|
|
279
|
+
}) {
|
|
280
|
+
return () => {
|
|
281
|
+
var r, o, i, c, u;
|
|
282
|
+
return y("div", T({
|
|
283
|
+
class: {
|
|
284
|
+
"comfy-tool--row": !0,
|
|
285
|
+
reverse: e.reverse
|
|
286
|
+
}
|
|
287
|
+
}, t), [((r = n.before) == null ? void 0 : r.call(n)) || "", ((o = n["before-content"]) == null ? void 0 : o.call(n)) || "", y("div", {
|
|
288
|
+
class: "main-content"
|
|
289
|
+
}, [((i = n.default) == null ? void 0 : i.call(n)) || ""]), ((c = n["after-content"]) == null ? void 0 : c.call(n)) || "", ((u = n.after) == null ? void 0 : u.call(n)) || ""]);
|
|
290
|
+
};
|
|
291
|
+
}
|
|
292
|
+
}), Wt = $(Rt), Vt = {
|
|
293
|
+
/** 当需要设定宽高时可能需要设置为 `-`;需要撑满容器时设置为 `100%` */
|
|
294
|
+
flex: {
|
|
295
|
+
type: [Number, String],
|
|
296
|
+
default: 1
|
|
297
|
+
},
|
|
298
|
+
width: [Number, String],
|
|
299
|
+
height: [Number, String],
|
|
300
|
+
minWidth: [Number, String],
|
|
301
|
+
minHeight: [Number, String],
|
|
302
|
+
maxWidth: [Number, String],
|
|
303
|
+
/**
|
|
304
|
+
* @description 最大高度
|
|
305
|
+
* @default 'none'
|
|
306
|
+
*/
|
|
307
|
+
maxHeight: [Number, String],
|
|
308
|
+
/** 启用flexbox横向布局 */
|
|
309
|
+
row: Boolean,
|
|
310
|
+
/** 启用flexbox纵向布局 */
|
|
311
|
+
column: Boolean
|
|
312
|
+
}, Ut = /* @__PURE__ */ L({
|
|
313
|
+
name: "expended",
|
|
314
|
+
inheritAttrs: !1,
|
|
315
|
+
props: Vt,
|
|
316
|
+
setup(e, {
|
|
317
|
+
attrs: t,
|
|
318
|
+
slots: n
|
|
319
|
+
}) {
|
|
320
|
+
const r = {
|
|
321
|
+
flex: ""
|
|
322
|
+
}, o = [];
|
|
323
|
+
if (e.flex)
|
|
324
|
+
switch (e.flex) {
|
|
325
|
+
case "100%":
|
|
326
|
+
r.flex = "unset", r.width = "100%";
|
|
327
|
+
break;
|
|
328
|
+
case "-":
|
|
329
|
+
r.flex = "unset";
|
|
330
|
+
break;
|
|
331
|
+
default:
|
|
332
|
+
r.flex = e.flex;
|
|
333
|
+
break;
|
|
334
|
+
}
|
|
335
|
+
return e.minWidth && (r.minWidth = h(e.minWidth, "px")), e.minHeight && (r.minHeight = h(e.minHeight, "px")), e.maxWidth && (r.maxWidth = h(e.maxWidth, "px")), e.maxHeight && (r.maxHeight = h(e.maxHeight, "px")), e.width && (r.width = h(e.width, "px")), e.height && (r.height = h(e.height, "px")), e.column ? o.push("u-flex-nowrap u-box-flex-col") : e.row && o.push("u-flex-wrap"), () => {
|
|
336
|
+
var i;
|
|
337
|
+
return y("div", T({
|
|
338
|
+
style: r,
|
|
339
|
+
class: T({
|
|
340
|
+
class: ["comfy-tool--expended", ...o]
|
|
341
|
+
})
|
|
342
|
+
}, t), [((i = n.default) == null ? void 0 : i.call(n)) || ""]);
|
|
343
|
+
};
|
|
344
|
+
}
|
|
345
|
+
}), jt = $(Ut), Ft = {
|
|
346
|
+
Column: Ht,
|
|
347
|
+
Row: Wt,
|
|
348
|
+
Expended: jt
|
|
349
|
+
};
|
|
350
|
+
function Yt(e) {
|
|
351
|
+
e[F] || (e[F] = !0, X(Ft).forEach(([t, n]) => {
|
|
352
|
+
e.component(t, n);
|
|
353
|
+
}));
|
|
556
354
|
}
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
container;
|
|
562
|
-
properties;
|
|
355
|
+
function Bt(e) {
|
|
356
|
+
wt({ app: e }), Nt(e), Yt(e);
|
|
357
|
+
}
|
|
358
|
+
class Kt {
|
|
563
359
|
constructor(t, n) {
|
|
564
360
|
this.properties = n, this.component = t, this.container = document.createElement("div");
|
|
565
|
-
const r =
|
|
566
|
-
|
|
361
|
+
const r = y(t, this.properties);
|
|
362
|
+
m.app && (r.appContext = m.app._context), ft(r, this.container), this.instance = r.component, this.appDOM = this.container.firstChild, this.init();
|
|
567
363
|
}
|
|
568
364
|
init() {
|
|
569
|
-
this.properties.teleport ? this.properties.teleport :
|
|
365
|
+
this.properties.teleport ? this.properties.teleport : m.rootId, this.appDOM && !this.appDOM.nodeName.startsWith("#") && document.body.appendChild(this.appDOM);
|
|
570
366
|
}
|
|
571
367
|
// 声明静态方法
|
|
572
368
|
static use(t) {
|
|
573
|
-
Object.assign(
|
|
369
|
+
Object.assign(m, t);
|
|
574
370
|
}
|
|
575
371
|
unmount() {
|
|
576
|
-
this.properties.teleport ? this.properties.teleport :
|
|
372
|
+
this.properties.teleport ? this.properties.teleport : m.rootId, document.body.removeChild(this.appDOM), this.instance.unmount();
|
|
577
373
|
}
|
|
578
374
|
close() {
|
|
579
375
|
this.toggle(!1);
|
|
@@ -582,14 +378,11 @@ class _t {
|
|
|
582
378
|
t ? this.instance.open(n) : this.instance.close(n);
|
|
583
379
|
}
|
|
584
380
|
}
|
|
585
|
-
|
|
586
|
-
class: "dialog"
|
|
587
|
-
}, null)]);
|
|
588
|
-
const Z = {
|
|
381
|
+
const B = {
|
|
589
382
|
show: !1,
|
|
590
383
|
// 扩展
|
|
591
384
|
keepAlive: !1
|
|
592
|
-
},
|
|
385
|
+
}, qt = /* @__PURE__ */ L({
|
|
593
386
|
name: "comfy-tool-layer",
|
|
594
387
|
components: {},
|
|
595
388
|
emits: ["confirm", "close", "cancel"],
|
|
@@ -599,93 +392,86 @@ const Z = {
|
|
|
599
392
|
slots: r,
|
|
600
393
|
expose: o
|
|
601
394
|
}) {
|
|
602
|
-
const
|
|
603
|
-
let
|
|
604
|
-
const
|
|
605
|
-
...Z,
|
|
606
|
-
...t,
|
|
607
|
-
...e
|
|
608
|
-
}), h = {
|
|
395
|
+
const i = V(null), c = V(null), u = st(!0);
|
|
396
|
+
let d;
|
|
397
|
+
const l = dt(f(f(f({}, B), t), e)), C = {
|
|
609
398
|
onConfirm() {
|
|
610
399
|
},
|
|
611
400
|
onClose() {
|
|
612
401
|
}
|
|
613
|
-
},
|
|
402
|
+
}, M = y("div", {
|
|
614
403
|
style: {
|
|
615
404
|
height: "150px"
|
|
616
405
|
}
|
|
617
406
|
}, null);
|
|
618
|
-
function
|
|
619
|
-
|
|
407
|
+
function te(a) {
|
|
408
|
+
l.show = a;
|
|
620
409
|
}
|
|
621
|
-
function
|
|
622
|
-
return
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
}), f;
|
|
410
|
+
function ne() {
|
|
411
|
+
return d = yt(c.value, M, _(f({}, l.contentProps), {
|
|
412
|
+
LAYERSHOW: l.show
|
|
413
|
+
})), d;
|
|
626
414
|
}
|
|
627
|
-
function
|
|
628
|
-
let
|
|
629
|
-
return !
|
|
415
|
+
function oe() {
|
|
416
|
+
let a;
|
|
417
|
+
return !l.keepAlive && !l.show && !u.value ? a = () => M : a = r.default ? r.default : ne, () => a();
|
|
630
418
|
}
|
|
631
|
-
function
|
|
632
|
-
|
|
419
|
+
function re() {
|
|
420
|
+
v.cancel();
|
|
633
421
|
}
|
|
634
|
-
function
|
|
635
|
-
if (
|
|
422
|
+
function x(a) {
|
|
423
|
+
if (d && d.component) {
|
|
636
424
|
let {
|
|
637
|
-
ctx:
|
|
638
|
-
exposed:
|
|
639
|
-
} =
|
|
640
|
-
|
|
425
|
+
ctx: g,
|
|
426
|
+
exposed: O
|
|
427
|
+
} = d.component;
|
|
428
|
+
O && O[a] ? O[a]() : g && g[a] && g[a]();
|
|
641
429
|
}
|
|
642
430
|
}
|
|
643
|
-
let
|
|
644
|
-
function
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
}, 500),
|
|
648
|
-
|
|
431
|
+
let w;
|
|
432
|
+
function D(a) {
|
|
433
|
+
l.show = a, l.show || l.keepAlive ? (u.value = !0, w && clearTimeout(w), w = null) : w = setTimeout(() => {
|
|
434
|
+
u.value = !1;
|
|
435
|
+
}, 500), pt(() => {
|
|
436
|
+
l.show && (x("onLayerShow"), x("queryData"));
|
|
649
437
|
});
|
|
650
438
|
}
|
|
651
|
-
const
|
|
652
|
-
init(
|
|
653
|
-
|
|
439
|
+
const v = {
|
|
440
|
+
init(a = {}, g = B) {
|
|
441
|
+
P(l, g, a && E(a, ["content", "baseContent"])), a.onConfirm && (C.onConfirm = a.onConfirm), a.onClose && (C.onClose = a.onClose), a.baseContent && (i.value = a.baseContent), c.value = a.content;
|
|
654
442
|
},
|
|
655
|
-
open(
|
|
656
|
-
|
|
443
|
+
open(a) {
|
|
444
|
+
v.init(a, {}), D(!0);
|
|
657
445
|
},
|
|
658
|
-
confirm(
|
|
659
|
-
n("confirm"),
|
|
446
|
+
confirm(a) {
|
|
447
|
+
n("confirm"), D(!!C.onConfirm(a, v.close));
|
|
660
448
|
},
|
|
661
|
-
close(
|
|
662
|
-
|
|
449
|
+
close(a = "complete") {
|
|
450
|
+
C.onClose(a), n("close"), D(!1), x("onClose");
|
|
663
451
|
},
|
|
664
452
|
cancel() {
|
|
665
|
-
|
|
453
|
+
v.close("cancel"), n("cancel"), x("onCancel");
|
|
666
454
|
}
|
|
667
455
|
};
|
|
668
|
-
return
|
|
669
|
-
|
|
670
|
-
}), o(
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
overlayContent: r.overlayContent
|
|
684
|
-
}) : "";
|
|
456
|
+
return mt(() => t, (a) => {
|
|
457
|
+
P(l, {}, a);
|
|
458
|
+
}), o(v), ht("Layer", v), () => {
|
|
459
|
+
var a;
|
|
460
|
+
return i.value ? N(i.value, _(f(f(f({
|
|
461
|
+
class: ["comfy-tool--layer", (a = l.class) != null ? a : ""],
|
|
462
|
+
style: f({}, l.style)
|
|
463
|
+
}, t), l.baseContentProps), E(l, ["content", "contentProps", "onClose", "width", "height", "class", "style", "baseContent", "baseContentProps"])), {
|
|
464
|
+
"onUpdate:show": te,
|
|
465
|
+
onClose: re
|
|
466
|
+
}), {
|
|
467
|
+
default: oe(),
|
|
468
|
+
overlayContent: r.overlayContent
|
|
469
|
+
}) : "";
|
|
470
|
+
};
|
|
685
471
|
}
|
|
686
472
|
});
|
|
687
|
-
var
|
|
688
|
-
class
|
|
473
|
+
var p;
|
|
474
|
+
class A extends Kt {
|
|
689
475
|
constructor(t, n) {
|
|
690
476
|
super(t, n);
|
|
691
477
|
}
|
|
@@ -693,217 +479,45 @@ class M extends _t {
|
|
|
693
479
|
return this.appDOM && document.body.appendChild(this.appDOM), this.instance.exposed.open(t);
|
|
694
480
|
}
|
|
695
481
|
static create(t = {}, n = !0) {
|
|
696
|
-
if (!
|
|
697
|
-
let r = new
|
|
482
|
+
if (!p || n) {
|
|
483
|
+
let r = new A(qt, t);
|
|
698
484
|
if (n) return r;
|
|
699
|
-
|
|
485
|
+
p || (p = r);
|
|
700
486
|
} else
|
|
701
|
-
|
|
702
|
-
return
|
|
487
|
+
p.instance.exposed.init(t);
|
|
488
|
+
return p;
|
|
703
489
|
}
|
|
704
490
|
}
|
|
705
|
-
function
|
|
491
|
+
function ee(e, t = !1) {
|
|
706
492
|
return new Promise((n, r) => {
|
|
707
|
-
|
|
708
|
-
onConfirm(o,
|
|
493
|
+
A.create({}, t).open(f({
|
|
494
|
+
onConfirm(o, i) {
|
|
709
495
|
n(o);
|
|
710
496
|
},
|
|
711
497
|
onClose(o) {
|
|
712
498
|
r(o);
|
|
713
|
-
}
|
|
714
|
-
|
|
715
|
-
});
|
|
499
|
+
}
|
|
500
|
+
}, e));
|
|
716
501
|
});
|
|
717
502
|
}
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
};
|
|
722
|
-
H.Component = yt(B);
|
|
723
|
-
H.Component = B;
|
|
724
|
-
const xt = {
|
|
725
|
-
mounted(e, t, n, r) {
|
|
726
|
-
typeof t.value == "function" && t.value(e);
|
|
727
|
-
},
|
|
728
|
-
unmounted(e, t, n, r) {
|
|
729
|
-
typeof t.value == "function" && t.value(null);
|
|
730
|
-
}
|
|
731
|
-
}, St = {
|
|
732
|
-
mounted(e, t, n, r) {
|
|
733
|
-
e.focus();
|
|
734
|
-
},
|
|
735
|
-
updated(e, t, n, r) {
|
|
736
|
-
}
|
|
737
|
-
}, Tt = function(t, n, r, o) {
|
|
738
|
-
t.style.height = t.parentElement.offsetHeight + "px", t.style.minHeight = "100%";
|
|
739
|
-
};
|
|
740
|
-
function kt(e, t, n, r) {
|
|
741
|
-
if (t.value.__used) return;
|
|
742
|
-
let o = { ...t.value };
|
|
743
|
-
if (o.behavior = o.behavior || "smooth", typeof o.right == "number" && (o.left = e.scrollWidth - o.right), typeof o.bottom == "number" && (o.top = e.scrollHeight - o.bottom), o.target) {
|
|
744
|
-
let l = we(o.target);
|
|
745
|
-
if (l) {
|
|
746
|
-
let { offsetTop: i, offsetLeft: a } = l.offsetParent || { offsetTop: 0, offsetLeft: 0 };
|
|
747
|
-
o.left = l.offsetLeft - e.offsetLeft + a, o.top = l.offsetTop - e.offsetTop + i;
|
|
748
|
-
}
|
|
749
|
-
}
|
|
750
|
-
o.left && typeof o.offsetX == "number" && (o.left += o.offsetX), o.top && typeof o.offsetY == "number" && (o.top += o.offsetY), Object.defineProperty(t.value, "__used", {
|
|
751
|
-
value: !0,
|
|
752
|
-
enumerable: !1,
|
|
753
|
-
writable: !0
|
|
754
|
-
}), o.beforeScroll ? o.beforeScroll(() => {
|
|
755
|
-
e.scrollTo(o);
|
|
756
|
-
}, o, e) : e.scrollTo(o);
|
|
757
|
-
}
|
|
758
|
-
const Q = Symbol("INSTALLED_KEY"), q = Symbol("COMPONENT_INSTALLED_KEY"), ee = Symbol("DIRECTIVES_INSTALLED_KEY"), R = {
|
|
759
|
-
dom: xt,
|
|
760
|
-
focus: St,
|
|
761
|
-
maxHeight: Tt,
|
|
762
|
-
scroll: kt
|
|
763
|
-
};
|
|
764
|
-
function It(e) {
|
|
765
|
-
if (!e[ee]) {
|
|
766
|
-
e[ee] = !0;
|
|
767
|
-
for (const t of Object.keys(R))
|
|
768
|
-
e.directive(R[t].name || t, R[t]);
|
|
769
|
-
}
|
|
770
|
-
}
|
|
771
|
-
const Lt = I({
|
|
772
|
-
name: "column",
|
|
773
|
-
inheritAttrs: !1,
|
|
774
|
-
props: {
|
|
775
|
-
bgGray: {
|
|
776
|
-
type: Boolean
|
|
777
|
-
},
|
|
778
|
-
bgGrey: {
|
|
779
|
-
type: Boolean
|
|
780
|
-
},
|
|
781
|
-
reverse: {
|
|
782
|
-
type: Boolean
|
|
783
|
-
}
|
|
784
|
-
},
|
|
785
|
-
setup() {
|
|
786
|
-
}
|
|
787
|
-
}), K = (e, t) => {
|
|
788
|
-
const n = e.__vccOpts || e;
|
|
789
|
-
for (const [r, o] of t)
|
|
790
|
-
n[r] = o;
|
|
791
|
-
return n;
|
|
792
|
-
}, Mt = { class: "main-content" };
|
|
793
|
-
function Ht(e, t, n, r, o, l) {
|
|
794
|
-
return F(), W("div", V({
|
|
795
|
-
class: ["layoututil_column", { reverse: e.reverse }]
|
|
796
|
-
}, e.$attrs), [
|
|
797
|
-
y(e.$slots, "before"),
|
|
798
|
-
y(e.$slots, "before-content"),
|
|
799
|
-
te("div", Mt, [
|
|
800
|
-
y(e.$slots, "default")
|
|
801
|
-
]),
|
|
802
|
-
y(e.$slots, "after-content"),
|
|
803
|
-
y(e.$slots, "after")
|
|
804
|
-
], 16);
|
|
805
|
-
}
|
|
806
|
-
const Pt = /* @__PURE__ */ K(Lt, [["render", Ht]]), Nt = I({
|
|
807
|
-
name: "row",
|
|
808
|
-
inheritAttrs: !1,
|
|
809
|
-
props: {
|
|
810
|
-
bgGray: {
|
|
811
|
-
type: Boolean
|
|
812
|
-
},
|
|
813
|
-
bgGrey: {
|
|
814
|
-
type: Boolean
|
|
815
|
-
},
|
|
816
|
-
reverse: {
|
|
817
|
-
type: Boolean
|
|
818
|
-
}
|
|
819
|
-
},
|
|
820
|
-
setup() {
|
|
821
|
-
}
|
|
822
|
-
}), Rt = { class: "main-content" };
|
|
823
|
-
function Ut(e, t, n, r, o, l) {
|
|
824
|
-
return F(), W("div", V({
|
|
825
|
-
class: ["layoututil_row", { reverse: e.reverse }]
|
|
826
|
-
}, e.$attrs), [
|
|
827
|
-
y(e.$slots, "before"),
|
|
828
|
-
y(e.$slots, "before-content"),
|
|
829
|
-
te("div", Rt, [
|
|
830
|
-
y(e.$slots, "default")
|
|
831
|
-
]),
|
|
832
|
-
y(e.$slots, "after-content"),
|
|
833
|
-
y(e.$slots, "after")
|
|
834
|
-
], 16);
|
|
835
|
-
}
|
|
836
|
-
const jt = /* @__PURE__ */ K(Nt, [["render", Ut]]), Wt = I({
|
|
837
|
-
name: "expended",
|
|
838
|
-
inheritAttrs: !1,
|
|
839
|
-
props: {
|
|
840
|
-
flex: {
|
|
841
|
-
type: [Number, String],
|
|
842
|
-
default: 1
|
|
843
|
-
},
|
|
844
|
-
width: [Number, String],
|
|
845
|
-
height: [Number, String],
|
|
846
|
-
minWidth: [Number, String],
|
|
847
|
-
minHeight: [Number, String],
|
|
848
|
-
maxWidth: [Number, String],
|
|
849
|
-
maxHeight: [Number, String],
|
|
850
|
-
row: Boolean,
|
|
851
|
-
column: Boolean
|
|
852
|
-
},
|
|
853
|
-
setup(e) {
|
|
854
|
-
const t = {
|
|
855
|
-
flex: ""
|
|
856
|
-
}, n = [];
|
|
857
|
-
switch (e.flex) {
|
|
858
|
-
case "100%":
|
|
859
|
-
t.flex = "unset", t.width = "100%";
|
|
860
|
-
break;
|
|
861
|
-
case "-":
|
|
862
|
-
t.flex = "unset";
|
|
863
|
-
break;
|
|
864
|
-
default:
|
|
865
|
-
t.flex = e.flex;
|
|
866
|
-
break;
|
|
867
|
-
}
|
|
868
|
-
return e.minWidth && (t.minWidth = v(e.minWidth, "px")), e.minHeight && (t.minHeight = v(e.minHeight, "px")), e.maxWidth && (t.maxWidth = v(e.maxWidth, "px")), e.maxHeight && (t.maxHeight = v(e.maxHeight, "px")), e.width && (t.width = v(e.width, "px")), e.height && (t.height = v(e.height, "px")), e.column ? n.push("u-flex-nowrap u-box-flex-col") : e.row && n.push("u-flex-wrap"), {
|
|
869
|
-
style: t,
|
|
870
|
-
className: n
|
|
871
|
-
};
|
|
872
|
-
}
|
|
873
|
-
});
|
|
874
|
-
function Ft(e, t, n, r, o, l) {
|
|
875
|
-
return F(), W("div", V({
|
|
876
|
-
class: ["layoututil_expended", e.className],
|
|
877
|
-
style: e.style
|
|
878
|
-
}, e.$attrs), [
|
|
879
|
-
y(e.$slots, "default")
|
|
880
|
-
], 16);
|
|
881
|
-
}
|
|
882
|
-
const Vt = /* @__PURE__ */ K(Wt, [["render", Ft]]), Yt = {
|
|
883
|
-
column: Pt,
|
|
884
|
-
row: jt,
|
|
885
|
-
expended: Vt
|
|
503
|
+
ee.create = A.create;
|
|
504
|
+
ee.close = () => {
|
|
505
|
+
p && p.close();
|
|
886
506
|
};
|
|
887
|
-
|
|
888
|
-
e[q] || (e[q] = !0, le(Yt).forEach(([t, n]) => {
|
|
889
|
-
e.component(t, n);
|
|
890
|
-
}));
|
|
891
|
-
}
|
|
892
|
-
const zt = "1.0.1", Xt = At;
|
|
893
|
-
function Kt(e) {
|
|
894
|
-
$t({ app: e }), It(e), Bt(e);
|
|
895
|
-
}
|
|
896
|
-
const Zt = {
|
|
507
|
+
const Zt = "1.0.4", Qt = Dt, en = {
|
|
897
508
|
install(e) {
|
|
898
|
-
e[
|
|
509
|
+
e[j] || (e[j] = !0, Bt(e));
|
|
899
510
|
}
|
|
900
511
|
};
|
|
901
512
|
export {
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
513
|
+
Ht as Column,
|
|
514
|
+
Qt as ComfyTool,
|
|
515
|
+
jt as Expended,
|
|
516
|
+
ee as Layer,
|
|
517
|
+
Wt as Row,
|
|
518
|
+
wt as configComfyTool,
|
|
519
|
+
en as default,
|
|
906
520
|
Jt as resourceLoader,
|
|
907
|
-
|
|
908
|
-
|
|
521
|
+
Bt as useComfyTool,
|
|
522
|
+
Zt as version
|
|
909
523
|
};
|