comfy-tool 1.0.3 → 1.0.5

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