comfy-tool 1.0.3 → 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.
Files changed (40) 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 → Expended/Expended.d.ts} +16 -13
  6. package/@types/components/layout/Expended/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 +9 -9
  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 +5 -0
  20. package/@types/globals.d.ts +3 -9
  21. package/@types/index.d.ts +2 -3
  22. package/@types/shims-vue.d.ts +2 -1
  23. package/@types/utils/app/installer.d.ts +8 -0
  24. package/@types/utils/tools.d.ts +11 -0
  25. package/@types/utils/ui/index.d.ts +3 -0
  26. package/@types/utils/util/basic.d.ts +2 -6
  27. package/@types/utils/util/date.d.ts +1 -1
  28. package/@types/utils/util/index.d.ts +5 -10
  29. package/@types/utils/util/url.d.ts +21 -2
  30. package/README.md +57 -24
  31. package/dist/index.css +1 -1
  32. package/dist/index.min.js +1 -1
  33. package/es/index.mjs +381 -791
  34. package/es/utils.mjs +484 -0
  35. package/lib/index.js +1 -1
  36. package/lib/utils.js +1 -0
  37. package/package.json +29 -14
  38. package/web-types.json +1 -0
  39. package/@types/components/layout/Column.vue.d.ts +0 -26
  40. 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 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
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
+ ce.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) => 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) {
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(K("-" + 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 yt(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 vt(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 gt(e) {
28
+ let t = Z(e);
427
29
  t && (t.scrollTop = 0);
428
30
  }
429
- function Ee(e) {
31
+ function Z(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 Q(e) {
35
+ let t = ct(e);
36
+ return vt(t) ? t.$el : t instanceof HTMLElement ? t : null;
435
37
  }
436
- function It(e, t) {
38
+ function bt(e, t) {
437
39
  return getComputedStyle(e).getPropertyValue(t);
438
40
  }
439
- function Lt(e, t, n = !0) {
41
+ function Ct(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 xt(e = {}) {
49
+ e.rootId && (m.rootId = e.rootId), e.app && (m.app = e.app);
448
50
  }
449
- const E = {
51
+ const b = {
450
52
  toast(e) {
451
53
  },
452
54
  alert(e) {
@@ -457,154 +59,317 @@ 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 wt(e) {
63
+ let t = z(m);
64
+ xt(q(e, t)), G(b, E(e, t), {
463
65
  deepMerge: !0,
464
66
  arrayMergeStrategy: "concat"
465
67
  });
466
68
  }
467
- function z(e) {
468
- E.toast(e);
69
+ function St() {
469
70
  }
470
- function Pt(e) {
471
- E.alert(e);
71
+ function Et(e) {
72
+ }
73
+ function Tt(e) {
74
+ H(e);
472
75
  }
473
- const T = {
76
+ function H(e) {
77
+ b.toast(e);
78
+ }
79
+ function Lt(e) {
80
+ b.alert(e);
81
+ }
82
+ const S = {
474
83
  show(e = "") {
475
- E.showLoading(e);
84
+ b.showLoading(e);
476
85
  },
477
86
  hide() {
478
- E.hideLoading();
87
+ b.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 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();
485
98
  }
486
- const Rt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
99
+ const Dt = /* @__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,
498
- 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] = {
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,
128
+ getElementPropertyValue: bt,
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,
159
+ removeEmptyForArr: Xe,
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] = {
564
179
  status: 2,
565
180
  waiters: []
566
181
  }, new Promise((t, n) => {
567
182
  const r = () => {
568
- i(), f();
183
+ c(), d();
569
184
  }, o = () => {
570
- a(), f();
185
+ u(), 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 c() {
190
+ s[e.url].status = 1, S.hide(), t(e.url), J(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 u() {
193
+ s[e.url].status = 0, S.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 Jt(e) {
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;
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: 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);
583
353
  }));
584
354
  }
585
- function an(e) {
586
- return Array.isArray(e) ? Promise.all(e.map((t) => oe(t))) : oe(e);
355
+ function Bt(e) {
356
+ wt({ app: e }), Nt(e), Yt(e);
587
357
  }
588
- class Ut {
358
+ class Kt {
589
359
  constructor(t, n) {
590
- C(this, "component");
591
- C(this, "appDOM");
592
- C(this, "instance");
593
- C(this, "container");
594
- C(this, "properties");
595
360
  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();
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();
598
363
  }
599
364
  init() {
600
- this.properties.teleport ? this.properties.teleport : v.rootId, this.appDOM && !this.appDOM.nodeName.startsWith("#") && document.body.appendChild(this.appDOM);
365
+ this.properties.teleport ? this.properties.teleport : m.rootId, this.appDOM && !this.appDOM.nodeName.startsWith("#") && document.body.appendChild(this.appDOM);
601
366
  }
602
367
  // 声明静态方法
603
368
  static use(t) {
604
- Object.assign(v, t);
369
+ Object.assign(m, t);
605
370
  }
606
371
  unmount() {
607
- this.properties.teleport ? this.properties.teleport : v.rootId, document.body.removeChild(this.appDOM), this.instance.unmount();
372
+ this.properties.teleport ? this.properties.teleport : m.rootId, document.body.removeChild(this.appDOM), this.instance.unmount();
608
373
  }
609
374
  close() {
610
375
  this.toggle(!1);
@@ -613,14 +378,11 @@ class Ut {
613
378
  t ? this.instance.open(n) : this.instance.close(n);
614
379
  }
615
380
  }
616
- k(Ne, null, [k("div", {
617
- class: "dialog"
618
- }, null)]);
619
- const re = {
381
+ const B = {
620
382
  show: !1,
621
383
  // 扩展
622
384
  keepAlive: !1
623
- }, X = /* @__PURE__ */ H({
385
+ }, qt = /* @__PURE__ */ L({
624
386
  name: "comfy-tool-layer",
625
387
  components: {},
626
388
  emits: ["confirm", "close", "cancel"],
@@ -630,87 +392,86 @@ const re = {
630
392
  slots: r,
631
393
  expose: o
632
394
  }) {
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 = {
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 = {
636
398
  onConfirm() {
637
399
  },
638
400
  onClose() {
639
401
  }
640
- }, c = k("div", {
402
+ }, M = y("div", {
641
403
  style: {
642
404
  height: "150px"
643
405
  }
644
406
  }, null);
645
- function d(u) {
646
- s.show = u;
407
+ function te(a) {
408
+ l.show = a;
647
409
  }
648
- function A() {
649
- return f = St(i.value, c, S(m({}, s.contentProps), {
650
- LAYERSHOW: s.show
651
- })), f;
410
+ function ne() {
411
+ return d = yt(c.value, M, _(f({}, l.contentProps), {
412
+ LAYERSHOW: l.show
413
+ })), d;
652
414
  }
653
- function _e() {
654
- let u;
655
- return !s.keepAlive && !s.show && !a.value ? u = () => c : u = r.default ? r.default : A, () => u();
415
+ function oe() {
416
+ let a;
417
+ return !l.keepAlive && !l.show && !u.value ? a = () => M : a = r.default ? r.default : ne, () => a();
656
418
  }
657
- function xe() {
658
- D.cancel();
419
+ function re() {
420
+ v.cancel();
659
421
  }
660
- function _(u) {
661
- if (f && f.component) {
422
+ function x(a) {
423
+ if (d && d.component) {
662
424
  let {
663
- ctx: O,
664
- exposed: j
665
- } = f.component;
666
- j && j[u] ? j[u]() : O && O[u] && O[u]();
425
+ ctx: g,
426
+ exposed: O
427
+ } = d.component;
428
+ O && O[a] ? O[a]() : g && g[a] && g[a]();
667
429
  }
668
430
  }
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"));
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"));
675
437
  });
676
438
  }
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;
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;
680
442
  },
681
- open(u) {
682
- D.init(u, {}), U(!0);
443
+ open(a) {
444
+ v.init(a, {}), D(!0);
683
445
  },
684
- confirm(u) {
685
- n("confirm"), U(!!h.onConfirm(u, D.close));
446
+ confirm(a) {
447
+ n("confirm"), D(!!C.onConfirm(a, v.close));
686
448
  },
687
- close(u = "complete") {
688
- h.onClose(u), n("close"), U(!1), _("onClose");
449
+ close(a = "complete") {
450
+ C.onClose(a), n("close"), D(!1), x("onClose");
689
451
  },
690
452
  cancel() {
691
- D.close("cancel"), n("cancel"), _("onCancel");
453
+ v.close("cancel"), n("cancel"), x("onCancel");
692
454
  }
693
455
  };
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
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
705
466
  }), {
706
- default: _e(),
467
+ default: oe(),
707
468
  overlayContent: r.overlayContent
708
469
  }) : "";
709
470
  };
710
471
  }
711
472
  });
712
- var b;
713
- class N extends Ut {
473
+ var p;
474
+ class A extends Kt {
714
475
  constructor(t, n) {
715
476
  super(t, n);
716
477
  }
@@ -718,19 +479,19 @@ class N extends Ut {
718
479
  return this.appDOM && document.body.appendChild(this.appDOM), this.instance.exposed.open(t);
719
480
  }
720
481
  static create(t = {}, n = !0) {
721
- if (!b || n) {
722
- let r = new N(X, t);
482
+ if (!p || n) {
483
+ let r = new A(qt, t);
723
484
  if (n) return r;
724
- b || (b = r);
485
+ p || (p = r);
725
486
  } else
726
- b.instance.exposed.init(t);
727
- return b;
487
+ p.instance.exposed.init(t);
488
+ return p;
728
489
  }
729
490
  }
730
- function R(e, t = !1) {
491
+ function ee(e, t = !1) {
731
492
  return new Promise((n, r) => {
732
- N.create({}, t).open(m({
733
- onConfirm(o, l) {
493
+ A.create({}, t).open(f({
494
+ onConfirm(o, i) {
734
495
  n(o);
735
496
  },
736
497
  onClose(o) {
@@ -739,195 +500,24 @@ function R(e, t = !1) {
739
500
  }, e));
740
501
  });
741
502
  }
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
503
+ ee.create = A.create;
504
+ ee.close = () => {
505
+ p && p.close();
910
506
  };
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 = {
507
+ const Zt = "1.0.4", Qt = Dt, en = {
921
508
  install(e) {
922
- e[le] || (e[le] = !0, rn(e));
509
+ e[j] || (e[j] = !0, Bt(e));
923
510
  }
924
511
  };
925
512
  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
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,
520
+ Jt as resourceLoader,
521
+ Bt as useComfyTool,
522
+ Zt as version
933
523
  };