comfy-tool 1.0.4 → 1.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/es/index.mjs CHANGED
@@ -1,54 +1,54 @@
1
- var ie = Object.defineProperty, ae = Object.defineProperties;
2
- var le = Object.getOwnPropertyDescriptors;
1
+ var ae = Object.defineProperty, le = Object.defineProperties;
2
+ var ce = Object.getOwnPropertyDescriptors;
3
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) => {
4
+ var fe = Object.prototype.hasOwnProperty, ue = 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, u = (e, t) => {
6
6
  for (var n in t || (t = {}))
7
- ue.call(t, n) && W(e, n, t[n]);
7
+ fe.call(t, n) && W(e, n, t[n]);
8
8
  if (R)
9
9
  for (var n of R(t))
10
- ce.call(t, n) && W(e, n, t[n]);
10
+ ue.call(t, n) && W(e, n, t[n]);
11
11
  return 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";
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 ft, unref as ut, 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
15
  function $(e) {
16
16
  return e.install = (t) => {
17
17
  let { name: n } = e;
18
- t.component(n, e), t.component(K("-" + n), e);
18
+ t.component(n, e), t.component(q("-" + n), e);
19
19
  }, e;
20
20
  }
21
- function yt(e, t = N("div"), n) {
22
- return e ? typeof e == "function" ? e() || t : N(e, n && ut(n)) : t;
21
+ function vt(e, t = N("div"), n) {
22
+ return e ? typeof e == "function" ? e() || t : N(e, n && ft(n)) : t;
23
23
  }
24
- function vt(e) {
24
+ function gt(e) {
25
25
  return !!(e && e.$el && e.$props && e.$options && e.$emit);
26
26
  }
27
- function gt(e) {
28
- let t = Z(e);
27
+ function bt(e) {
28
+ let t = Q(e);
29
29
  t && (t.scrollTop = 0);
30
30
  }
31
- function Z(e) {
31
+ function Q(e) {
32
32
  return document.getElementById(e);
33
33
  }
34
- function Q(e) {
35
- let t = ct(e);
36
- return vt(t) ? t.$el : t instanceof HTMLElement ? t : null;
34
+ function ee(e) {
35
+ let t = ut(e);
36
+ return gt(t) ? t.$el : t instanceof HTMLElement ? t : null;
37
37
  }
38
- function bt(e, t) {
38
+ function Ct(e, t) {
39
39
  return getComputedStyle(e).getPropertyValue(t);
40
40
  }
41
- function Ct(e, t, n = !0) {
41
+ function xt(e, t, n = !0) {
42
42
  e.classList.remove(...t.split(" ")), n && e.classList.add(t);
43
43
  }
44
44
  const m = {
45
45
  rootId: "app",
46
46
  app: void 0
47
47
  };
48
- function xt(e = {}) {
48
+ function wt(e = {}) {
49
49
  e.rootId && (m.rootId = e.rootId), e.app && (m.app = e.app);
50
50
  }
51
- const b = {
51
+ const C = {
52
52
  toast(e) {
53
53
  },
54
54
  alert(e) {
@@ -59,32 +59,32 @@ const b = {
59
59
  hideLoading() {
60
60
  }
61
61
  };
62
- function wt(e) {
63
- let t = z(m);
64
- xt(q(e, t)), G(b, E(e, t), {
62
+ function St(e) {
63
+ let t = G(m);
64
+ wt(z(e, t)), X(C, b(e, t), {
65
65
  deepMerge: !0,
66
66
  arrayMergeStrategy: "concat"
67
67
  });
68
68
  }
69
- function St() {
70
- }
71
- function Et(e) {
69
+ function Et() {
72
70
  }
73
71
  function Tt(e) {
72
+ }
73
+ function Lt(e) {
74
74
  H(e);
75
75
  }
76
76
  function H(e) {
77
- b.toast(e);
77
+ C.toast(e);
78
78
  }
79
- function Lt(e) {
80
- b.alert(e);
79
+ function At(e) {
80
+ C.alert(e);
81
81
  }
82
- const S = {
82
+ const E = {
83
83
  show(e = "") {
84
- b.showLoading(e);
84
+ C.showLoading(e);
85
85
  },
86
86
  hide() {
87
- b.hideLoading();
87
+ C.hideLoading();
88
88
  }
89
89
  };
90
90
  let k;
@@ -92,204 +92,206 @@ try {
92
92
  k = document.createElement("a");
93
93
  } catch (e) {
94
94
  }
95
- function At(e, t = "未获取到联系电话") {
95
+ function Dt(e, t = "未获取到联系电话") {
96
96
  if (!e) return H(t);
97
97
  e = typeof e == "number" ? e.toString() : e, k.href = /^tel:.*/.test(e) ? e : "tel:" + e, k.click();
98
98
  }
99
- const Dt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
99
+ const Ot = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
100
100
  __proto__: null,
101
- $: Z,
102
- $alert: Lt,
103
- $loading: S,
104
- $refDOM: Q,
101
+ $: Q,
102
+ $alert: At,
103
+ $loading: E,
104
+ $refDOM: ee,
105
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,
106
+ Fn: se,
107
+ addUnit: p,
108
+ arrayToGroup: de,
109
+ base64ToBlob: me,
110
+ camelize: q,
111
+ cloneJSON: he,
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
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
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
174
  }, Symbol.toStringTag, { value: "Module" })), s = {};
175
- function U(e) {
175
+ function F(e) {
176
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
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] = {
178
+ }) : e.production ? Promise.resolve("Ignored in development environment!") : (E.show("资源加载中"), s[e.url] ? s[e.url].status = 2 : s[e.url] = {
179
179
  status: 2,
180
180
  waiters: []
181
181
  }, new Promise((t, n) => {
182
- const r = () => {
182
+ const o = () => {
183
+ f(), d();
184
+ }, r = () => {
183
185
  c(), d();
184
- }, o = () => {
185
- u(), d();
186
186
  };
187
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]);
188
+ e.type === "js" ? (i = document.createElement("script"), i.src = e.url, i.onload = o, i.onerror = r) : e.type === "css" && (i = document.createElement("link"), i.rel = "stylesheet", i.href = e.url, i.onload = o, i.onerror = r), i && document.head.appendChild(i);
189
+ function f() {
190
+ s[e.url].status = 1, E.hide(), t(e.url), Z(s[e.url].waiters, [e.url]);
191
191
  }
192
- function u() {
193
- s[e.url].status = 0, S.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));
194
194
  }
195
195
  function d() {
196
196
  i && (i.onload = null, i.onerror = null);
197
197
  }
198
198
  }));
199
199
  }
200
- function Jt(e) {
201
- return Array.isArray(e) ? Promise.all(e.map((t) => U(t))) : U(e);
200
+ function Zt(e) {
201
+ return Array.isArray(e) ? Promise.all(e.map((t) => F(t))) : F(e);
202
202
  }
203
- const j = Symbol("INSTALLED_KEY"), F = Symbol("COMPONENT_INSTALLED_KEY"), Y = Symbol("DIRECTIVES_INSTALLED_KEY"), Ot = {
204
- mounted(e, t, n, r) {
203
+ const U = Symbol("INSTALLED_KEY"), Y = Symbol("COMPONENT_INSTALLED_KEY"), B = Symbol("DIRECTIVES_INSTALLED_KEY"), _t = {
204
+ mounted(e, t, n, o) {
205
205
  typeof t.value == "function" && t.value(e);
206
206
  },
207
- unmounted(e, t, n, r) {
207
+ unmounted(e, t, n, o) {
208
208
  typeof t.value == "function" && t.value(null);
209
209
  }
210
- }, _t = {
211
- mounted(e, t, n, r) {
210
+ }, It = {
211
+ mounted(e, t, n, o) {
212
212
  e.focus();
213
213
  },
214
- updated(e, t, n, r) {
214
+ updated(e, t, n, o) {
215
215
  }
216
- }, It = function(t, n, r, o) {
216
+ }, Pt = function(t, n, o, r) {
217
217
  t.style.height = t.parentElement.offsetHeight + "px", t.style.minHeight = "100%";
218
218
  };
219
- function Pt(e, t, n, r) {
219
+ function Nt(e, t, n, o) {
220
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);
221
+ let r = u({}, t.value);
222
+ if (r.behavior = r.behavior || "smooth", typeof r.right == "number" && (r.left = e.scrollWidth - r.right), typeof r.bottom == "number" && (r.top = e.scrollHeight - r.bottom), r.target) {
223
+ let i = ee(r.target);
224
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;
225
+ let { offsetTop: f, offsetLeft: c } = i.offsetParent || { offsetTop: 0, offsetLeft: 0 };
226
+ r.left = i.offsetLeft - e.offsetLeft + c, r.top = i.offsetTop - e.offsetTop + f;
227
227
  }
228
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", {
229
+ r.left && typeof r.offsetX == "number" && (r.left += r.offsetX), r.top && typeof r.offsetY == "number" && (r.top += r.offsetY), Object.defineProperty(t.value, "__used", {
230
230
  value: !0,
231
231
  enumerable: !1,
232
232
  writable: !0
233
- }), o.beforeScroll ? o.beforeScroll(() => {
234
- e.scrollTo(o);
235
- }, o, e) : e.scrollTo(o);
233
+ }), r.beforeScroll ? r.beforeScroll(() => {
234
+ e.scrollTo(r);
235
+ }, r, e) : e.scrollTo(r);
236
236
  }
237
237
  const I = {
238
- dom: Ot,
239
- focus: _t,
240
- maxHeight: It,
241
- scroll: Pt
238
+ dom: _t,
239
+ focus: It,
240
+ maxHeight: Pt,
241
+ scroll: Nt
242
242
  };
243
- function Nt(e) {
244
- if (!e[Y]) {
245
- e[Y] = !0;
243
+ function kt(e) {
244
+ if (!e[B]) {
245
+ e[B] = !0;
246
246
  for (const t of Object.keys(I))
247
247
  e.directive(I[t].name || t, I[t]);
248
248
  }
249
249
  }
250
- const kt = {
250
+ const $t = {
251
251
  reverse: Boolean
252
- }, $t = /* @__PURE__ */ L({
252
+ }, Ht = /* @__PURE__ */ L({
253
253
  name: "column",
254
254
  inheritAttrs: !1,
255
- props: kt,
255
+ props: $t,
256
256
  setup(e, {
257
257
  attrs: t,
258
258
  slots: n
259
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)) || ""]);
260
+ return () => {
261
+ var o, r, i, f, c;
262
+ return h("div", T({
263
+ class: {
264
+ "comfy-tool--column": !0,
265
+ reverse: e.reverse
266
+ }
267
+ }, t), [((o = n.before) == null ? void 0 : o.call(n)) || "", ((r = n["before-content"]) == null ? void 0 : r.call(n)) || "", h("div", {
268
+ class: "main-content"
269
+ }, [((i = n.default) == null ? void 0 : i.call(n)) || ""]), ((f = n["after-content"]) == null ? void 0 : f.call(n)) || "", ((c = n.after) == null ? void 0 : c.call(n)) || ""]);
270
+ };
269
271
  }
270
- }), Ht = $($t), Mt = {
272
+ }), Mt = $(Ht), Rt = {
271
273
  reverse: Boolean
272
- }, Rt = /* @__PURE__ */ L({
274
+ }, Wt = /* @__PURE__ */ L({
273
275
  name: "row",
274
276
  inheritAttrs: !1,
275
- props: Mt,
277
+ props: Rt,
276
278
  setup(e, {
277
279
  attrs: t,
278
280
  slots: n
279
281
  }) {
280
282
  return () => {
281
- var r, o, i, c, u;
282
- return y("div", T({
283
+ var o, r, i, f, c;
284
+ return h("div", T({
283
285
  class: {
284
286
  "comfy-tool--row": !0,
285
287
  reverse: e.reverse
286
288
  }
287
- }, t), [((r = n.before) == null ? void 0 : r.call(n)) || "", ((o = n["before-content"]) == null ? void 0 : o.call(n)) || "", y("div", {
289
+ }, t), [((o = n.before) == null ? void 0 : o.call(n)) || "", ((r = n["before-content"]) == null ? void 0 : r.call(n)) || "", h("div", {
288
290
  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)) || ""]);
291
+ }, [((i = n.default) == null ? void 0 : i.call(n)) || ""]), ((f = n["after-content"]) == null ? void 0 : f.call(n)) || "", ((c = n.after) == null ? void 0 : c.call(n)) || ""]);
290
292
  };
291
293
  }
292
- }), Wt = $(Rt), Vt = {
294
+ }), Vt = $(Wt), jt = {
293
295
  /** 当需要设定宽高时可能需要设置为 `-`;需要撑满容器时设置为 `100%` */
294
296
  flex: {
295
297
  type: [Number, String],
@@ -309,117 +311,136 @@ const kt = {
309
311
  row: Boolean,
310
312
  /** 启用flexbox纵向布局 */
311
313
  column: Boolean
312
- }, Ut = /* @__PURE__ */ L({
314
+ }, Ft = /* @__PURE__ */ L({
313
315
  name: "expended",
314
316
  inheritAttrs: !1,
315
- props: Vt,
317
+ props: jt,
316
318
  setup(e, {
317
319
  attrs: t,
318
320
  slots: n
319
321
  }) {
320
- const r = {
322
+ const o = {
321
323
  flex: ""
322
- }, o = [];
324
+ }, r = [];
323
325
  if (e.flex)
324
326
  switch (e.flex) {
325
327
  case "100%":
326
- r.flex = "unset", r.width = "100%";
328
+ o.flex = "unset", o.width = "100%";
327
329
  break;
328
330
  case "-":
329
- r.flex = "unset";
331
+ o.flex = "unset";
330
332
  break;
331
333
  default:
332
- r.flex = e.flex;
334
+ o.flex = e.flex;
333
335
  break;
334
336
  }
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"), () => {
337
+ return e.minWidth && (o.minWidth = p(e.minWidth, "px")), e.minHeight && (o.minHeight = p(e.minHeight, "px")), e.maxWidth && (o.maxWidth = p(e.maxWidth, "px")), e.maxHeight && (o.maxHeight = p(e.maxHeight, "px")), e.width && (o.width = p(e.width, "px")), e.height && (o.height = p(e.height, "px")), e.column ? r.push("u-flex-nowrap u-box-flex-col") : e.row && r.push("u-flex-wrap"), () => {
336
338
  var i;
337
- return y("div", T({
338
- style: r,
339
+ return h("div", T({
340
+ style: o,
339
341
  class: T({
340
- class: ["comfy-tool--expended", ...o]
342
+ class: ["comfy-tool--expended", ...r]
341
343
  })
342
344
  }, t), [((i = n.default) == null ? void 0 : i.call(n)) || ""]);
343
345
  };
344
346
  }
345
- }), jt = $(Ut), Ft = {
346
- Column: Ht,
347
- Row: Wt,
348
- Expended: jt
347
+ }), Ut = $(Ft), Yt = {
348
+ Column: Mt,
349
+ Row: Vt,
350
+ Expanded: Ut
349
351
  };
350
- function Yt(e) {
351
- e[F] || (e[F] = !0, X(Ft).forEach(([t, n]) => {
352
+ function Bt(e) {
353
+ e[Y] || (e[Y] = !0, J(Yt).forEach(([t, n]) => {
352
354
  e.component(t, n);
353
355
  }));
354
356
  }
355
- function Bt(e) {
356
- wt({ app: e }), Nt(e), Yt(e);
357
+ function Kt(e) {
358
+ St({ app: e }), kt(e), Bt(e);
357
359
  }
358
- class Kt {
360
+ class qt {
359
361
  constructor(t, n) {
360
362
  this.properties = n, this.component = t, this.container = document.createElement("div");
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();
363
+ const o = h(t, this.properties);
364
+ m.app && (o.appContext = m.app._context), V(o, this.container), this.instance = o.component, this.appDOM = this.container, this.init();
363
365
  }
364
366
  init() {
365
- this.properties.teleport ? this.properties.teleport : m.rootId, this.appDOM && !this.appDOM.nodeName.startsWith("#") && document.body.appendChild(this.appDOM);
367
+ this.mount();
366
368
  }
367
369
  // 声明静态方法
368
370
  static use(t) {
369
371
  Object.assign(m, t);
370
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);
377
+ }
371
378
  unmount() {
372
- this.properties.teleport ? this.properties.teleport : m.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);
373
381
  }
374
382
  close() {
375
383
  this.toggle(!1);
376
384
  }
377
385
  toggle(t, n) {
378
- t ? this.instance.open(n) : this.instance.close(n);
386
+ if (t) {
387
+ let o = this.instance.open || this.instance.exposed.open;
388
+ o == null || o(n);
389
+ } else {
390
+ let o = this.instance.close || this.instance.exposed.close;
391
+ o == null || o(n);
392
+ }
379
393
  }
380
394
  }
381
- const B = {
395
+ const K = {
382
396
  show: !1,
383
397
  // 扩展
384
398
  keepAlive: !1
385
- }, qt = /* @__PURE__ */ L({
399
+ }, zt = /* @__PURE__ */ L({
386
400
  name: "comfy-tool-layer",
401
+ inheritAttrs: !1,
387
402
  components: {},
403
+ props: {
404
+ baseContent: {
405
+ type: Object,
406
+ default: null
407
+ }
408
+ },
388
409
  emits: ["confirm", "close", "cancel"],
389
410
  setup(e, {
390
411
  attrs: t,
391
412
  emit: n,
392
- slots: r,
393
- expose: o
413
+ slots: o,
414
+ expose: r
394
415
  }) {
395
- const i = V(null), c = V(null), u = st(!0);
416
+ const i = j(e.baseContent), f = j(null), c = st(!0);
396
417
  let d;
397
- const l = dt(f(f(f({}, B), t), e)), C = {
418
+ const l = dt(u(u(u({}, K), t), e)), x = {
398
419
  onConfirm() {
399
420
  },
400
421
  onClose() {
401
422
  }
402
- }, M = y("div", {
423
+ }, M = h("div", {
403
424
  style: {
404
425
  height: "150px"
405
426
  }
406
427
  }, null);
407
- function te(a) {
428
+ function ne(a) {
408
429
  l.show = a;
409
430
  }
410
- function ne() {
411
- return d = yt(c.value, M, _(f({}, l.contentProps), {
431
+ function oe() {
432
+ return d = vt(f.value, M, _(u({}, l.contentProps), {
412
433
  LAYERSHOW: l.show
413
434
  })), d;
414
435
  }
415
- function oe() {
436
+ function re() {
416
437
  let a;
417
- return !l.keepAlive && !l.show && !u.value ? a = () => M : a = r.default ? r.default : ne, () => a();
438
+ return !l.keepAlive && !l.show && !c.value ? a = () => M : a = o.default ? o.default : oe, () => a();
418
439
  }
419
- function re() {
440
+ function ie() {
420
441
  v.cancel();
421
442
  }
422
- function x(a) {
443
+ function w(a) {
423
444
  if (d && d.component) {
424
445
  let {
425
446
  ctx: g,
@@ -428,96 +449,96 @@ const B = {
428
449
  O && O[a] ? O[a]() : g && g[a] && g[a]();
429
450
  }
430
451
  }
431
- let w;
452
+ let S;
432
453
  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"));
454
+ l.show = a, l.show || l.keepAlive ? (c.value = !0, S && clearTimeout(S), S = null) : S = setTimeout(() => {
455
+ c.value = !1;
456
+ }, 500), yt(() => {
457
+ l.show && (w("onLayerShow"), w("queryData"));
437
458
  });
438
459
  }
439
460
  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;
461
+ init(a = {}, g = K) {
462
+ 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), f.value = a.content;
442
463
  },
443
464
  open(a) {
444
465
  v.init(a, {}), D(!0);
445
466
  },
446
467
  confirm(a) {
447
- n("confirm"), D(!!C.onConfirm(a, v.close));
468
+ n("confirm"), D(!!x.onConfirm(a, v.close));
448
469
  },
449
470
  close(a = "complete") {
450
- C.onClose(a), n("close"), D(!1), x("onClose");
471
+ x.onClose(a), n("close"), D(!1), w("onClose");
451
472
  },
452
473
  cancel() {
453
- v.close("cancel"), n("cancel"), x("onCancel");
474
+ v.close("cancel"), n("cancel"), w("onCancel");
454
475
  }
455
476
  };
456
477
  return mt(() => t, (a) => {
457
478
  P(l, {}, a);
458
- }), o(v), ht("Layer", v), () => {
479
+ }), r(v), ht("Layer", v), () => {
459
480
  var a;
460
- return i.value ? N(i.value, _(f(f(f({
481
+ return h(pt, null, [i.value ? N(i.value, _(u(u(u({
461
482
  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
483
+ style: u({}, l.style)
484
+ }, b(t, ["content", "contentProps", "baseContent", "baseContentProps"])), l.baseContentProps), b(l, ["content", "contentProps", "onClose", "width", "height", "class", "style", "baseContent", "baseContentProps"])), {
485
+ "onUpdate:show": ne,
486
+ onClose: ie
466
487
  }), {
467
- default: oe(),
468
- overlayContent: r.overlayContent
469
- }) : "";
488
+ default: re(),
489
+ overlayContent: o.overlayContent
490
+ }) : ""]);
470
491
  };
471
492
  }
472
493
  });
473
- var p;
474
- class A extends Kt {
494
+ var y;
495
+ class A extends qt {
475
496
  constructor(t, n) {
476
497
  super(t, n);
477
498
  }
478
499
  open(t) {
479
- return this.appDOM && document.body.appendChild(this.appDOM), this.instance.exposed.open(t);
500
+ return super.mount(), this.instance.exposed.open(t);
480
501
  }
481
502
  static create(t = {}, n = !0) {
482
- if (!p || n) {
483
- let r = new A(qt, t);
484
- if (n) return r;
485
- p || (p = r);
503
+ if (!y || n) {
504
+ let o = new A(zt, t);
505
+ if (n) return o;
506
+ y || (y = o);
486
507
  } else
487
- p.instance.exposed.init(t);
488
- return p;
508
+ y.instance.exposed.init(t);
509
+ return y;
489
510
  }
490
511
  }
491
- function ee(e, t = !1) {
492
- return new Promise((n, r) => {
493
- A.create({}, t).open(f({
494
- onConfirm(o, i) {
495
- n(o);
512
+ function te(e, t = !1) {
513
+ return new Promise((n, o) => {
514
+ A.create({}, t).open(u({
515
+ onConfirm(r, i) {
516
+ n(r);
496
517
  },
497
- onClose(o) {
498
- r(o);
518
+ onClose(r) {
519
+ o(r);
499
520
  }
500
521
  }, e));
501
522
  });
502
523
  }
503
- ee.create = A.create;
504
- ee.close = () => {
505
- p && p.close();
524
+ te.create = A.create;
525
+ te.close = () => {
526
+ y && y.close();
506
527
  };
507
- const Zt = "1.0.4", Qt = Dt, en = {
528
+ const Qt = "1.0.6", en = Ot, tn = {
508
529
  install(e) {
509
- e[j] || (e[j] = !0, Bt(e));
530
+ e[U] || (e[U] = !0, Kt(e));
510
531
  }
511
532
  };
512
533
  export {
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
534
+ Mt as Column,
535
+ en as ComfyTool,
536
+ Ut as Expanded,
537
+ te as Layer,
538
+ Vt as Row,
539
+ St as configComfyTool,
540
+ tn as default,
541
+ Zt as resourceLoader,
542
+ Kt as useComfyTool,
543
+ Qt as version
523
544
  };