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/@types/components/index.d.ts +1 -1
- package/@types/components/layout/Column/Column.d.ts +1 -1
- package/@types/components/layout/Column/index.d.ts +1 -1
- package/@types/components/layout/{Expended → Expanded}/index.d.ts +4 -4
- package/@types/components/utils/layer/Component.d.ts +15 -5
- package/@types/components/utils/layer/layer.d.ts +1 -1
- package/@types/demo/hooks/use-layer.d.ts +19 -0
- package/@types/demo/hooks/use-test-layer.d.ts +6 -0
- package/@types/globals.d.ts +10 -24
- package/@types/plugins/PopupCreator.d.ts +2 -1
- package/@types/utils/app/component.d.ts +1 -1
- package/@types/utils/tools.d.ts +1 -1
- package/@types/utils/util/array.d.ts +1 -0
- package/@types/utils/util/{formate.d.ts → format.d.ts} +1 -0
- package/@types/utils/util/function.d.ts +1 -1
- package/README.md +87 -36
- package/dist/index.min.js +1 -1
- package/es/index.mjs +274 -253
- package/lib/index.js +1 -1
- package/package.json +1 -1
- package/web-types.json +1 -1
- /package/@types/components/layout/{Expended/Expended.d.ts → Expanded/Expanded.d.ts} +0 -0
package/es/index.mjs
CHANGED
|
@@ -1,54 +1,54 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
1
|
+
var ae = Object.defineProperty, le = Object.defineProperties;
|
|
2
|
+
var ce = Object.getOwnPropertyDescriptors;
|
|
3
3
|
var R = Object.getOwnPropertySymbols;
|
|
4
|
-
var
|
|
5
|
-
var W = (e, t, n) => t in e ?
|
|
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
|
-
|
|
7
|
+
fe.call(t, n) && W(e, n, t[n]);
|
|
8
8
|
if (R)
|
|
9
9
|
for (var n of R(t))
|
|
10
|
-
|
|
10
|
+
ue.call(t, n) && W(e, n, t[n]);
|
|
11
11
|
return e;
|
|
12
|
-
}, _ = (e, t) =>
|
|
13
|
-
import { camelize as
|
|
14
|
-
import { h as N, reactive as
|
|
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(
|
|
18
|
+
t.component(n, e), t.component(q("-" + n), e);
|
|
19
19
|
}, e;
|
|
20
20
|
}
|
|
21
|
-
function
|
|
22
|
-
return e ? typeof e == "function" ? e() || t : N(e, n &&
|
|
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
|
|
24
|
+
function gt(e) {
|
|
25
25
|
return !!(e && e.$el && e.$props && e.$options && e.$emit);
|
|
26
26
|
}
|
|
27
|
-
function
|
|
28
|
-
let t =
|
|
27
|
+
function bt(e) {
|
|
28
|
+
let t = Q(e);
|
|
29
29
|
t && (t.scrollTop = 0);
|
|
30
30
|
}
|
|
31
|
-
function
|
|
31
|
+
function Q(e) {
|
|
32
32
|
return document.getElementById(e);
|
|
33
33
|
}
|
|
34
|
-
function
|
|
35
|
-
let t =
|
|
36
|
-
return
|
|
34
|
+
function ee(e) {
|
|
35
|
+
let t = ut(e);
|
|
36
|
+
return gt(t) ? t.$el : t instanceof HTMLElement ? t : null;
|
|
37
37
|
}
|
|
38
|
-
function
|
|
38
|
+
function Ct(e, t) {
|
|
39
39
|
return getComputedStyle(e).getPropertyValue(t);
|
|
40
40
|
}
|
|
41
|
-
function
|
|
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
|
|
48
|
+
function wt(e = {}) {
|
|
49
49
|
e.rootId && (m.rootId = e.rootId), e.app && (m.app = e.app);
|
|
50
50
|
}
|
|
51
|
-
const
|
|
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
|
|
63
|
-
let t =
|
|
64
|
-
|
|
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
|
|
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
|
-
|
|
77
|
+
C.toast(e);
|
|
78
78
|
}
|
|
79
|
-
function
|
|
80
|
-
|
|
79
|
+
function At(e) {
|
|
80
|
+
C.alert(e);
|
|
81
81
|
}
|
|
82
|
-
const
|
|
82
|
+
const E = {
|
|
83
83
|
show(e = "") {
|
|
84
|
-
|
|
84
|
+
C.showLoading(e);
|
|
85
85
|
},
|
|
86
86
|
hide() {
|
|
87
|
-
|
|
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
|
|
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
|
|
99
|
+
const Ot = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
100
100
|
__proto__: null,
|
|
101
|
-
$:
|
|
102
|
-
$alert:
|
|
103
|
-
$loading:
|
|
104
|
-
$refDOM:
|
|
101
|
+
$: Q,
|
|
102
|
+
$alert: At,
|
|
103
|
+
$loading: E,
|
|
104
|
+
$refDOM: ee,
|
|
105
105
|
$toast: H,
|
|
106
|
-
Fn:
|
|
107
|
-
addUnit:
|
|
108
|
-
arrayToGroup:
|
|
109
|
-
base64ToBlob:
|
|
110
|
-
camelize:
|
|
111
|
-
cloneJSON:
|
|
112
|
-
dateGo:
|
|
113
|
-
dealTime:
|
|
114
|
-
debounce:
|
|
115
|
-
decodeURIComponentSafe:
|
|
116
|
-
decodeURISafe:
|
|
117
|
-
deepClone:
|
|
118
|
-
deleteItemForArr:
|
|
119
|
-
emptyArray:
|
|
120
|
-
entriesOf:
|
|
121
|
-
errorCatch:
|
|
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:
|
|
124
|
-
formatSelectedData:
|
|
125
|
-
formatToSelectData:
|
|
126
|
-
getArrayDataIndex:
|
|
127
|
-
getDateConfig:
|
|
128
|
-
getElementPropertyValue:
|
|
129
|
-
getFuzzyMatchRegExp:
|
|
130
|
-
getPercentage:
|
|
131
|
-
getProperty:
|
|
132
|
-
getRandomElements:
|
|
133
|
-
getUniqueParam:
|
|
134
|
-
getWeek:
|
|
135
|
-
getWeekByNo:
|
|
136
|
-
hasSameItem:
|
|
137
|
-
isArrayString:
|
|
138
|
-
isFullUrl:
|
|
139
|
-
isNumber:
|
|
140
|
-
isObjectString:
|
|
141
|
-
isRegExpString:
|
|
142
|
-
isWebUrl:
|
|
143
|
-
kebabCase:
|
|
144
|
-
keysOf:
|
|
145
|
-
merge:
|
|
146
|
-
methodApply:
|
|
147
|
-
noop:
|
|
148
|
-
noopCatch:
|
|
149
|
-
padZero:
|
|
150
|
-
parseArray:
|
|
151
|
-
parseDate:
|
|
152
|
-
parseObject:
|
|
153
|
-
parseRegExp:
|
|
154
|
-
parseUrl:
|
|
155
|
-
pick:
|
|
156
|
-
pickEx:
|
|
157
|
-
queryParse:
|
|
158
|
-
queryStringify:
|
|
159
|
-
removeEmptyForArr:
|
|
160
|
-
removeFalseForArr:
|
|
161
|
-
removeItemForArr:
|
|
162
|
-
scrollToTop:
|
|
163
|
-
selectDataToObj:
|
|
164
|
-
shuffleArray:
|
|
165
|
-
telephoneCall:
|
|
166
|
-
throttle:
|
|
167
|
-
throttleAsync:
|
|
168
|
-
toFormData:
|
|
169
|
-
toSelectData:
|
|
170
|
-
toggleClass:
|
|
171
|
-
typeOf:
|
|
172
|
-
urlAddParams:
|
|
173
|
-
valuesOf:
|
|
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
|
|
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!") : (
|
|
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
|
|
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 =
|
|
189
|
-
function
|
|
190
|
-
s[e.url].status = 1,
|
|
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
|
|
193
|
-
s[e.url].status = 0,
|
|
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
|
|
201
|
-
return Array.isArray(e) ? Promise.all(e.map((t) =>
|
|
200
|
+
function Zt(e) {
|
|
201
|
+
return Array.isArray(e) ? Promise.all(e.map((t) => F(t))) : F(e);
|
|
202
202
|
}
|
|
203
|
-
const
|
|
204
|
-
mounted(e, t, n,
|
|
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,
|
|
207
|
+
unmounted(e, t, n, o) {
|
|
208
208
|
typeof t.value == "function" && t.value(null);
|
|
209
209
|
}
|
|
210
|
-
},
|
|
211
|
-
mounted(e, t, n,
|
|
210
|
+
}, It = {
|
|
211
|
+
mounted(e, t, n, o) {
|
|
212
212
|
e.focus();
|
|
213
213
|
},
|
|
214
|
-
updated(e, t, n,
|
|
214
|
+
updated(e, t, n, o) {
|
|
215
215
|
}
|
|
216
|
-
},
|
|
216
|
+
}, Pt = function(t, n, o, r) {
|
|
217
217
|
t.style.height = t.parentElement.offsetHeight + "px", t.style.minHeight = "100%";
|
|
218
218
|
};
|
|
219
|
-
function
|
|
219
|
+
function Nt(e, t, n, o) {
|
|
220
220
|
if (t.value.__used) return;
|
|
221
|
-
let
|
|
222
|
-
if (
|
|
223
|
-
let i =
|
|
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:
|
|
226
|
-
|
|
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
|
-
|
|
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
|
-
}),
|
|
234
|
-
e.scrollTo(
|
|
235
|
-
},
|
|
233
|
+
}), r.beforeScroll ? r.beforeScroll(() => {
|
|
234
|
+
e.scrollTo(r);
|
|
235
|
+
}, r, e) : e.scrollTo(r);
|
|
236
236
|
}
|
|
237
237
|
const I = {
|
|
238
|
-
dom:
|
|
239
|
-
focus:
|
|
240
|
-
maxHeight:
|
|
241
|
-
scroll:
|
|
238
|
+
dom: _t,
|
|
239
|
+
focus: It,
|
|
240
|
+
maxHeight: Pt,
|
|
241
|
+
scroll: Nt
|
|
242
242
|
};
|
|
243
|
-
function
|
|
244
|
-
if (!e[
|
|
245
|
-
e[
|
|
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
|
|
250
|
+
const $t = {
|
|
251
251
|
reverse: Boolean
|
|
252
|
-
},
|
|
252
|
+
}, Ht = /* @__PURE__ */ L({
|
|
253
253
|
name: "column",
|
|
254
254
|
inheritAttrs: !1,
|
|
255
|
-
props:
|
|
255
|
+
props: $t,
|
|
256
256
|
setup(e, {
|
|
257
257
|
attrs: t,
|
|
258
258
|
slots: n
|
|
259
259
|
}) {
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
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
|
-
}),
|
|
272
|
+
}), Mt = $(Ht), Rt = {
|
|
271
273
|
reverse: Boolean
|
|
272
|
-
},
|
|
274
|
+
}, Wt = /* @__PURE__ */ L({
|
|
273
275
|
name: "row",
|
|
274
276
|
inheritAttrs: !1,
|
|
275
|
-
props:
|
|
277
|
+
props: Rt,
|
|
276
278
|
setup(e, {
|
|
277
279
|
attrs: t,
|
|
278
280
|
slots: n
|
|
279
281
|
}) {
|
|
280
282
|
return () => {
|
|
281
|
-
var
|
|
282
|
-
return
|
|
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), [((
|
|
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)) || ""]), ((
|
|
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
|
-
}),
|
|
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
|
-
},
|
|
314
|
+
}, Ft = /* @__PURE__ */ L({
|
|
313
315
|
name: "expended",
|
|
314
316
|
inheritAttrs: !1,
|
|
315
|
-
props:
|
|
317
|
+
props: jt,
|
|
316
318
|
setup(e, {
|
|
317
319
|
attrs: t,
|
|
318
320
|
slots: n
|
|
319
321
|
}) {
|
|
320
|
-
const
|
|
322
|
+
const o = {
|
|
321
323
|
flex: ""
|
|
322
|
-
},
|
|
324
|
+
}, r = [];
|
|
323
325
|
if (e.flex)
|
|
324
326
|
switch (e.flex) {
|
|
325
327
|
case "100%":
|
|
326
|
-
|
|
328
|
+
o.flex = "unset", o.width = "100%";
|
|
327
329
|
break;
|
|
328
330
|
case "-":
|
|
329
|
-
|
|
331
|
+
o.flex = "unset";
|
|
330
332
|
break;
|
|
331
333
|
default:
|
|
332
|
-
|
|
334
|
+
o.flex = e.flex;
|
|
333
335
|
break;
|
|
334
336
|
}
|
|
335
|
-
return e.minWidth && (
|
|
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
|
|
338
|
-
style:
|
|
339
|
+
return h("div", T({
|
|
340
|
+
style: o,
|
|
339
341
|
class: T({
|
|
340
|
-
class: ["comfy-tool--expended", ...
|
|
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
|
-
}),
|
|
346
|
-
Column:
|
|
347
|
-
Row:
|
|
348
|
-
|
|
347
|
+
}), Ut = $(Ft), Yt = {
|
|
348
|
+
Column: Mt,
|
|
349
|
+
Row: Vt,
|
|
350
|
+
Expanded: Ut
|
|
349
351
|
};
|
|
350
|
-
function
|
|
351
|
-
e[
|
|
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
|
|
356
|
-
|
|
357
|
+
function Kt(e) {
|
|
358
|
+
St({ app: e }), kt(e), Bt(e);
|
|
357
359
|
}
|
|
358
|
-
class
|
|
360
|
+
class qt {
|
|
359
361
|
constructor(t, n) {
|
|
360
362
|
this.properties = n, this.component = t, this.container = document.createElement("div");
|
|
361
|
-
const
|
|
362
|
-
m.app && (
|
|
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.
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
395
|
+
const K = {
|
|
382
396
|
show: !1,
|
|
383
397
|
// 扩展
|
|
384
398
|
keepAlive: !1
|
|
385
|
-
},
|
|
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:
|
|
393
|
-
expose:
|
|
413
|
+
slots: o,
|
|
414
|
+
expose: r
|
|
394
415
|
}) {
|
|
395
|
-
const i =
|
|
416
|
+
const i = j(e.baseContent), f = j(null), c = st(!0);
|
|
396
417
|
let d;
|
|
397
|
-
const l = dt(
|
|
418
|
+
const l = dt(u(u(u({}, K), t), e)), x = {
|
|
398
419
|
onConfirm() {
|
|
399
420
|
},
|
|
400
421
|
onClose() {
|
|
401
422
|
}
|
|
402
|
-
}, M =
|
|
423
|
+
}, M = h("div", {
|
|
403
424
|
style: {
|
|
404
425
|
height: "150px"
|
|
405
426
|
}
|
|
406
427
|
}, null);
|
|
407
|
-
function
|
|
428
|
+
function ne(a) {
|
|
408
429
|
l.show = a;
|
|
409
430
|
}
|
|
410
|
-
function
|
|
411
|
-
return d =
|
|
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
|
|
436
|
+
function re() {
|
|
416
437
|
let a;
|
|
417
|
-
return !l.keepAlive && !l.show && !
|
|
438
|
+
return !l.keepAlive && !l.show && !c.value ? a = () => M : a = o.default ? o.default : oe, () => a();
|
|
418
439
|
}
|
|
419
|
-
function
|
|
440
|
+
function ie() {
|
|
420
441
|
v.cancel();
|
|
421
442
|
}
|
|
422
|
-
function
|
|
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
|
|
452
|
+
let S;
|
|
432
453
|
function D(a) {
|
|
433
|
-
l.show = a, l.show || l.keepAlive ? (
|
|
434
|
-
|
|
435
|
-
}, 500),
|
|
436
|
-
l.show && (
|
|
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 =
|
|
441
|
-
P(l, g, a &&
|
|
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(!!
|
|
468
|
+
n("confirm"), D(!!x.onConfirm(a, v.close));
|
|
448
469
|
},
|
|
449
470
|
close(a = "complete") {
|
|
450
|
-
|
|
471
|
+
x.onClose(a), n("close"), D(!1), w("onClose");
|
|
451
472
|
},
|
|
452
473
|
cancel() {
|
|
453
|
-
v.close("cancel"), n("cancel"),
|
|
474
|
+
v.close("cancel"), n("cancel"), w("onCancel");
|
|
454
475
|
}
|
|
455
476
|
};
|
|
456
477
|
return mt(() => t, (a) => {
|
|
457
478
|
P(l, {}, a);
|
|
458
|
-
}),
|
|
479
|
+
}), r(v), ht("Layer", v), () => {
|
|
459
480
|
var a;
|
|
460
|
-
return i.value ? N(i.value, _(
|
|
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:
|
|
463
|
-
}, t), l.baseContentProps),
|
|
464
|
-
"onUpdate:show":
|
|
465
|
-
onClose:
|
|
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:
|
|
468
|
-
overlayContent:
|
|
469
|
-
}) : "";
|
|
488
|
+
default: re(),
|
|
489
|
+
overlayContent: o.overlayContent
|
|
490
|
+
}) : ""]);
|
|
470
491
|
};
|
|
471
492
|
}
|
|
472
493
|
});
|
|
473
|
-
var
|
|
474
|
-
class A extends
|
|
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
|
|
500
|
+
return super.mount(), this.instance.exposed.open(t);
|
|
480
501
|
}
|
|
481
502
|
static create(t = {}, n = !0) {
|
|
482
|
-
if (!
|
|
483
|
-
let
|
|
484
|
-
if (n) return
|
|
485
|
-
|
|
503
|
+
if (!y || n) {
|
|
504
|
+
let o = new A(zt, t);
|
|
505
|
+
if (n) return o;
|
|
506
|
+
y || (y = o);
|
|
486
507
|
} else
|
|
487
|
-
|
|
488
|
-
return
|
|
508
|
+
y.instance.exposed.init(t);
|
|
509
|
+
return y;
|
|
489
510
|
}
|
|
490
511
|
}
|
|
491
|
-
function
|
|
492
|
-
return new Promise((n,
|
|
493
|
-
A.create({}, t).open(
|
|
494
|
-
onConfirm(
|
|
495
|
-
n(
|
|
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(
|
|
498
|
-
r
|
|
518
|
+
onClose(r) {
|
|
519
|
+
o(r);
|
|
499
520
|
}
|
|
500
521
|
}, e));
|
|
501
522
|
});
|
|
502
523
|
}
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
524
|
+
te.create = A.create;
|
|
525
|
+
te.close = () => {
|
|
526
|
+
y && y.close();
|
|
506
527
|
};
|
|
507
|
-
const
|
|
528
|
+
const Qt = "1.0.6", en = Ot, tn = {
|
|
508
529
|
install(e) {
|
|
509
|
-
e[
|
|
530
|
+
e[U] || (e[U] = !0, Kt(e));
|
|
510
531
|
}
|
|
511
532
|
};
|
|
512
533
|
export {
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
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
|
};
|